No video

Handle Calendar in Selenium WebDriver - Session - 16

  Рет қаралды 105,617

Naveen AutomationLabs

Naveen AutomationLabs

Күн бұрын

Handle Calendar in Selenium WebDriver - Session - 16:
Steps to handle calendar in Selenium Webdriver:
1- Click on calendar
2- Get all td of tables using findElements method
3- using for loop get text of all elements
4- using if else condition we will check specific date
5- If date is matched then click and break the loop.
6- Handle NoSuchElementException in case of (31st day)
=================================================
Learn How to for loop in Java:
• Learn for and while Lo...
====================================================
****Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
/ naveenautomationlabs
Follow me on my Facebook Page:
/ naveenqtpexpert
~-~~-~~~-~~-~
Follow my Site/Blog: www.naveenautom...
========================================================
Please watch: "Selenium & Automation Interview Preparation - By Naveen AutomationLabs"
• Selenium & Automation ...
~-~~-~~~-~~-~ Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautom...
API Course: www.naveenautom... ➡️Get Our Courses✔️
📗 Get My Paid Courses at
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautom...
API Course: www.naveenautom...
-------------------------------
✔️SOCIAL NETWORKS
Facebook: / naveenqtpexpert
Twitter: / naveenkhunteta
Blog: www.naveenautom...
--------------------------------
Support My Channel✔️Or Buy Me A Coffee
Paypal: paypal.me/nave...
Google Pay: naveenanimation20@gmail.com
--------------------------------
✔️Thanks for watching!
देखने के लिए धन्यवाद
Благодаря за гледането
感谢您观看
Merci d'avoir regardé
Grazie per la visione
Gracias por ver
شكرا للمشاهدة

Пікірлер: 86
@vithleshkumargupta
@vithleshkumargupta 4 жыл бұрын
Hi Naveen , There is one mistake so please put that in description - catch(NoSuchElementException e){ System.out.println("Please enter the correct date value); flag=false; // Should be flag = true , Mistake here , It should be set to true to break outer loop break ; } Thanks for the amazing content.
@omkarpotdar2763
@omkarpotdar2763 2 жыл бұрын
Thanks a lot Naveen for providing very good and easy solution for handling calendar. Really your videos are very useful in point of project work as well as interview purpose. Really appreciated your headwork.
@anshidance3279
@anshidance3279 4 жыл бұрын
Thank you sir for your Explanation.The way you explaining i like it very much.I never seen this type of explanation
@raunakgupta3746
@raunakgupta3746 4 жыл бұрын
Thank you @naveen for such amazing content, i have learned selenium through your youtube channel......Thank you once again.👍
@EliasHossein799
@EliasHossein799 2 жыл бұрын
So Excellent tutorial !!! you are the super hero !!!
@neetigogo
@neetigogo 6 жыл бұрын
Thanks a lot for this video Naveen. if you don't mind, I have one suggestion . For videos like this, it will be good if you can show how it looks while debugging and how value of variables are changing, it would help in understanding. I appreciate your efforts from the bottom of my heart .
@deepaknarang6190
@deepaknarang6190 6 жыл бұрын
Hi Naveen , very good explanation . i have one suggestion instead of flag you should use below code to break outerlook outerloop: for (int i=0; i < 5; i++) { for (int j=0; j < 5; j++) { if (i * j > 6) { System.out.println("Breaking"); break outerloop; } System.out.println(i + " " + j); } } System.out.println("Done");
@naveenautomationlabs
@naveenautomationlabs 6 жыл бұрын
thanks for suggestion but I dint get you code. can u plz take the same calendar example and implement ur logic accordingly
@sandeepkokane9549
@sandeepkokane9549 3 жыл бұрын
Thanks Naveen. Very nice video on calender
@aadiandadvikvlogs
@aadiandadvikvlogs 4 жыл бұрын
Well explained Naveen as usual. Thank you so much. You are the best !!
@prakashvish3988
@prakashvish3988 3 жыл бұрын
Very useful ❤️ thanks naveen ❤️
@shakshisingh1001
@shakshisingh1001 5 жыл бұрын
Hi Naveen, Thanks for the Java and selenium videos. It's very helpful. Do you any c# tutorial video. Can you please share c# tutorial video link if you have.
@manishaneharkar2009
@manishaneharkar2009 3 жыл бұрын
Very Nicely explained, i am glad that i have seen your channel and going through it , but application which you are using ie CRM site seems changed a lot , so not able to simulate into practice... can you please provide alternate site for same. Thanks in advance.
@tejasb2104
@tejasb2104 Жыл бұрын
The site used above is changed to "classic.freecrm.com". It was a bit difficult to find out, but luckily got it. You might not be practising now, but can help others.
@rajalakshmis201
@rajalakshmis201 5 жыл бұрын
Thank you Sir, clearly explained..
@Siva-en9sw
@Siva-en9sw 5 жыл бұрын
Excellent boss thank you
@sheikhkhurram1558
@sheikhkhurram1558 6 жыл бұрын
Hey , i did it in one line no need of two for loops . driver.findElement(By.xpath("//div[@id ='crmcalendar']//tr[2]//following-sibling::tr//td[contains (text() , '"+day+"')]")).click(); just pass the "day" value dynamically
@naveenautomationlabs
@naveenautomationlabs 6 жыл бұрын
Sheik Kurram using dynamic xpath following sibling I have explained in different video. This is for inywry point of view using for loop.
@mayurmunshi2
@mayurmunshi2 6 жыл бұрын
Very nicely explained !!!!!!
@mrpimpita5555
@mrpimpita5555 5 жыл бұрын
I have a problem in a calendar for example: Month of November the first at the beginning there are 29, 30, 31 and last row I also have 29, 30. As I do so I select November 30 but not October 30 since I am choosing October 30.
@reachtosky942
@reachtosky942 Жыл бұрын
Did you find any solution?
@usabI009
@usabI009 5 жыл бұрын
While using for loop method, you have worked with absolute xpath which might change. How to write customized xpath for selecting calendar dates as this one and then use for loop to select date ?
@thiery572
@thiery572 5 жыл бұрын
Very interesting. Thanks!
@LifeinSoBo
@LifeinSoBo 4 жыл бұрын
Hey Naveen thanks once again for an another excellent video. Naveen , could you suggest some certification courses for Automation Architect ?
@naveenautomationlabs
@naveenautomationlabs 4 жыл бұрын
Mail me at naveenanimation20@gmail.com
@reachtosky942
@reachtosky942 Жыл бұрын
@@naveenautomationlabs may I connect with you now to get the idea?
@sagarsapkota8023
@sagarsapkota8023 6 жыл бұрын
naveen its awesome.....
@jdhung
@jdhung 4 жыл бұрын
excellent video.
@tapaskhandai
@tapaskhandai 4 жыл бұрын
It is really helpful
@kirthinimal3062
@kirthinimal3062 4 жыл бұрын
Hi Naveen, This freecrm website is now been updated , im unable to click on the Calendar link , as i can see there no frame in there. i tired to inspect the same . but no luck. could you please help me on this. thanks
@manaligupta1098
@manaligupta1098 7 жыл бұрын
Great video. Thanks a lot
@WMohanty
@WMohanty 4 жыл бұрын
The website where you gave the example has changed a lot. Could you please give another wesbsite to ptactice. Thanks
@vikrantshingne8761
@vikrantshingne8761 3 жыл бұрын
Thank you sir. I have a question is that We have to hard code that selected value ?
@akulabhaskar3797
@akulabhaskar3797 6 жыл бұрын
Thanks Naveen
@ramakrishnants7826
@ramakrishnants7826 4 жыл бұрын
Can you please suggest a different website as lot of changes have happened to freecrm.co.in?
@mohammedmoinuddina2815
@mohammedmoinuddina2815 6 жыл бұрын
Hi Naveen, this is a great example for the date picker.. I used your concept and came up with the below simple solution by just having a stable xpath. Please review and provide your feedback: Thread.sleep(3000); driver.switchTo().frame("mainpanel"); String date= "23-December-2019"; String[] datearr = date.split("-"); String curdate = datearr[0]; String curmonth = datearr[1]; String curyear = datearr[2]; Select selmonth= new Select(driver.findElement(By.name("slctMonth"))); selmonth.selectByVisibleText("December"); Select selyear= new Select(driver.findElement(By.name("slctYear"))); selyear.selectByVisibleText("2019"); driver.findElement(By.xpath(".//*[@id='crmcalendar']//tbody//tr//td[contains(text(),'"+curdate+"')]")).click(); System.out.println("Clicked");; Thread.sleep(3000); driver.quit();
@mohammedmoinuddina2815
@mohammedmoinuddina2815 6 жыл бұрын
I have just concatenated the date in the xpath
@samlawrence541
@samlawrence541 6 жыл бұрын
hi Naveen, thanks so much for all your unquantifiable effort in all your videos. please, Naveen, I was validating a site for broken links but it terminated abruptly giving a MalFunctionUrlException. and another one gave me a StaleElementException. please, how do I handle this. thank u.
@manoharch1203
@manoharch1203 6 жыл бұрын
Hi Naveen, Please Make videos on Exception Handlings
@niranjanniru5671
@niranjanniru5671 3 жыл бұрын
As usual user the date format will be 01-July-2019 How will you handle 01 date, as 1 will be present in the element
@hydrasatya9565
@hydrasatya9565 4 жыл бұрын
in this program if i want to select next date what i hav to do... should i use flag++????
@rupeshgawande2716
@rupeshgawande2716 6 жыл бұрын
Hi Naveen I used this code in my framework. But how to set verification point for this?
@reachtosky942
@reachtosky942 Жыл бұрын
I wonder why we can't just use visible text ?
@JASSININETY
@JASSININETY 4 жыл бұрын
Naveen interviewer during selenium interview is asking if you are opening a website and it's opened as blank then how do you debug it.. Please suggest what should I answer them.
@praveenautomationinterview2367
@praveenautomationinterview2367 6 жыл бұрын
Hi Naveen, same issue is here also it is not printing the all values of "dayVal" , and printing uptill the selected date. e.g.: if we selected '19-September-2017' then it is printed only upto 19 and rest are not printed. please guide in this.
@bharathkoneru4008
@bharathkoneru4008 3 жыл бұрын
As you are breaking the inner loop on match & outer loop due to setting of flag value.. values after 19 will not be printed
@gopalsurse2071
@gopalsurse2071 5 жыл бұрын
Naveen please guide me for how to prepare machine test for software [Automation]testing profile [web application testing]
@myfocus7447
@myfocus7447 7 жыл бұрын
did u shared video to handle web table which has dynamic values
@naveenautomationlabs
@naveenautomationlabs 7 жыл бұрын
+Jyoshna Manubolu here it is: kzbin.info/www/bejne/i5aVdaB4fqiCoac
@myfocus7447
@myfocus7447 7 жыл бұрын
thanx it will be gud if u could explain us with getting dynamic row and column count as in real time we depend on this mostly
@sagarsapkota8023
@sagarsapkota8023 6 жыл бұрын
Jyoshna Manubolu dude check his youtube playlist how to become genius in xpath
@myfocus7447
@myfocus7447 7 жыл бұрын
useful
@balakrishnan1274
@balakrishnan1274 4 жыл бұрын
Hi Naveen , I have registered in freeCRM site i am not able to login to website which you mentioned in the video. Can you help is any website is there to test this cases. Here i am able to access the "ui.cogmento.com/home" page but here everything is different.
@heenasamreen3191
@heenasamreen3191 5 жыл бұрын
Can you tell how to upload or download file using selenium or autoit?
@swethavarma631
@swethavarma631 5 жыл бұрын
Hi , It is not printing blank space instead throwing me an exception NoSuchElementFound
@shivam_methi
@shivam_methi Жыл бұрын
have you found any solution for this?
@SunnyCool1110
@SunnyCool1110 6 жыл бұрын
Hi Naveen, I am unable to handle NoSuchElementException in console. Not printing the message
@kaulsandeep2318
@kaulsandeep2318 5 жыл бұрын
same problem here also I am unable to print the exception message " please enter the correct date"
@nalinaksheepanda1596
@nalinaksheepanda1596 5 жыл бұрын
I think, this is because, there are blank values available in those cell, which are printing in the console instead of the message.
@kimferko9038
@kimferko9038 5 жыл бұрын
Hi, does anybody know why why 'submit' Login button doesn't click on command: "driver.findElement(By.xpath("//*[@type= 'submit']")).click(); " Have tried also with Linktext and className. thank you. Nice videos!
@purnachandrapatra2552
@purnachandrapatra2552 6 жыл бұрын
catch(NoSuchElementException e){System.out.println("please enter correct value"); flag = true; break; i think we need to set the flag as true
@VijayKumar-nv9wy
@VijayKumar-nv9wy 5 жыл бұрын
Yes. I assume the same as by default false is set for flag variable.
@srihari4827
@srihari4827 5 жыл бұрын
Yes inside the catch block flag=true In order for the outer loop to break
@priyavijayakumar1509
@priyavijayakumar1509 6 жыл бұрын
how to handle calendar in new event page in freecrm application
@xoda345
@xoda345 5 жыл бұрын
If i do not have firepath/firebug then I would not get the xpath in these format. So, how to automate in that case?
@raghuveermh6869
@raghuveermh6869 5 жыл бұрын
If you inspect the element, the element DOM structure will come in blue colour. Right clik on it, select copy--copy Xpath. it will give same xpath present in firepath
@xoda345
@xoda345 5 жыл бұрын
@@raghuveermh6869 but that's in Firefox..what about chrome?
@raghuveermh6869
@raghuveermh6869 5 жыл бұрын
In chrome also it will work, I am using same thing I don't have chropath and all. I am writing custom xpath, hardly I will use this method
@praveen420ify
@praveen420ify 6 жыл бұрын
As Firebug is not supported in Mozilla 55+ version then how can we take Absolute path here for reading calendar date?
@nikitagyanchandani97
@nikitagyanchandani97 6 жыл бұрын
You can use chroPath which is also an extension for chrome browser..just like firebug, firepath in mozilla firefox
@neetigogo
@neetigogo 6 жыл бұрын
Hi Nikita, Thanks for telling about Chropath, but in chrome, chropath is giving relative xpath and in firefox, absolute xpath. have you noticed that?
@srihari4827
@srihari4827 5 жыл бұрын
@@neetigogo we get both absolute and relative xpath using chropath
@himanshusinghal7359
@himanshusinghal7359 4 жыл бұрын
can you share this particular code
@myfocus7447
@myfocus7447 7 жыл бұрын
if we can get dynamic row count no need of handling this no element found exception
@naveenautomationlabs
@naveenautomationlabs 7 жыл бұрын
+Jyoshna Manubolu correct but still it's good to handle nosuchelementexception. I have seen couple of cases where some hidden tr tags are there and selenium doesn't catch them. This is just to show how will u handle runtime exceptions.
@myfocus7447
@myfocus7447 7 жыл бұрын
ok ..thanx
@BhardwajFamily1
@BhardwajFamily1 5 жыл бұрын
Hi Naveen,Thanks for sharing this important video,I am not able to get that exception handling, I have written below code:WebDriver driver=new ChromeDriver(); driver.manage().deleteAllCookies(); driver.manage().window().maximize(); driver.get("www.freecrm.com/"); driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); driver.findElement(By.name("username")).sendKeys("ajay_automation"); driver.findElement(By.name("password")).sendKeys("ajay@2301"); Thread.sleep(4000); driver.findElement(By.xpath("//input[@type='submit']")).click(); Thread.sleep(4000); driver.switchTo().frame(1); String date= "31-November-2019"; String newdate[]=date.split("-"); String day= newdate[0]; String month= newdate[1]; String year= newdate[2]; Thread.sleep(4000); Select select= new Select(driver.findElement(By.name("slctMonth"))); select.selectByVisibleText(month); Select select1= new Select(driver.findElement(By.name("slctYear"))); select1.selectByVisibleText(year); // //*[@id="crmcalendar"]/table/tbody/tr[2]/td/table/tbody/tr[2]/td[7] String before= "//*[@id=\"crmcalendar\"]/table/tbody/tr[2]/td/table/tbody/tr["; String after="]/td["; boolean flag=false; String newvale = null; final int totalnumberdays=7; for(int i=2;i
@shivi9112
@shivi9112 Жыл бұрын
Can you please again provide ID and password for logiin page.
@arpitadas9542
@arpitadas9542 5 жыл бұрын
hi
@shreyanshjain2347
@shreyanshjain2347 7 жыл бұрын
at 41:20 when flag will be false then if(flag) will not be executed. this if block will only be executed only when flag is true.
@naveenautomationlabs
@naveenautomationlabs 7 жыл бұрын
Correct, because no need to execute outer for loop if expected value is found. Also if date is not appropriate after inner loop will be terminated. Check with all the boundary values and debug the code, you will have a clear picture.
@shreyanshjain2347
@shreyanshjain2347 7 жыл бұрын
Naveen AutomationLabs yes I know that u mentioned in the video that if flag is false then control will come to outer loop and will execute if loop and outer loop will break so I thought of commenting here because people will think like if flag is false then also if(flag) is executing.
@naveenautomationlabs
@naveenautomationlabs 7 жыл бұрын
Thanks @Shreyansh!
@amitbhardwaj1511
@amitbhardwaj1511 6 жыл бұрын
I am still confused with if statement🤔
Handle Calendar/DatePicker using JavaScriptExecutor - Session -17
17:30
Naveen AutomationLabs
Рет қаралды 98 М.
How to Become Genius in XPath in Selenium  - Session -18
39:48
Naveen AutomationLabs
Рет қаралды 716 М.
КАКУЮ ДВЕРЬ ВЫБРАТЬ? 😂 #Shorts
00:45
НУБАСТЕР
Рет қаралды 3,1 МЛН
Look at two different videos 😁 @karina-kola
00:11
Andrey Grechka
Рет қаралды 14 МЛН
الذرة أنقذت حياتي🌽😱
00:27
Cool Tool SHORTS Arabic
Рет қаралды 13 МЛН
How to find broken links & Images using Selenium Webdriver
45:35
Naveen AutomationLabs
Рет қаралды 98 М.
What is Selenium WebDriver Architecture?
50:38
Naveen AutomationLabs
Рет қаралды 149 М.
P26 - Capture screenshots for only failed tests in TestNG | TestNG |
47:47
Selenium Framework Tutorial #9 - Data Driven Testing with TestNG DataProvider
17:35
How to Capture Screenshot in Selenium Webdriver
26:03
Mukesh otwani
Рет қаралды 201 М.
Headless Browser Testing using HTMLUnitDriver in Selenium - Session 10
19:53
Naveen AutomationLabs
Рет қаралды 60 М.
How to Handle Dynamic WebTable - WebDriver Session 14
33:42
Naveen AutomationLabs
Рет қаралды 201 М.