If you are searching for Selenium Webdriver tutorial then your search ends here. You can find the number of different topics which you will find in your day to day activity while doing automation. Selenium Webdriver is one of trending topic nowadays for Automation field and it is a highest paying job as well.
To learn Selenium Webdriver you should have at least one programming language. Currently, Selenium Webdriver is most popular with Java and C# so if you know any of the languages then it won’t be tough.
I have published some of the Java Videos on YouTube which will give you a quick start to learning Selenium Webdriver. Once you are done with Basic Selenium Webdriver then you can switch to Advance Selenium Tutorial with advanced Java topics.
Must read article before going Selenium Webdriver Tutorial
List of java topic for Selenium
Best way to learn any automation tool
Pain of an Automation Engg and Best practices to avoid
Difference between Webdriver, RC and IDE
Top 100 Selenium Interview questions
Module 1-Selenium Webdriver tutorial
Setup the Environment- Setup Java, Eclipse, Selenium, TestNG
Configure Setup-Eclipse,Selenium,TestNG
Module 2-Selenium Webdriver tutorial
Execute testcases in firefox browser using Selenium Webdriver
New- Start Firefox in Selenium 3 using Gecko driver
Start Firefox Browser in MAC Machine using Selenium Webdriver
Guide to execute testcases in Chrome browser using Selenium Webdriver
Start Chrome Browser in MAC machine using Selenium Webdriver
Remove or Disable Developer add-on in Chrome while running Selenium Test (New)
Hide or Block pop-up notification in Chrome browser during Selenium Test Execution (New)
How to execute testcases in IE browser using Selenium Webdriver
Execute your Selenium Webdriver Test on Microsoft Edge Browser
How To Disable Personalise your web experience Microsoft Edge Prompt In Selenium
Challenges with IE browser in Selenium Webdriver
Complete stydy of Dynamic XPath in Selenium
Write your own CSS in selenium to make script faster
How to verify Page title in Selenium Webdriver
How to work with Radio button and Checkbox in Selenium Webdriver
Handle Basic Dropdown in Selenium WebDriver
Handle BootStrap Dropdown in Selenium WebDriver
How to work with file uploader or How to upload file in Selenium (using Robot class)
How to work with file uploader or How to upload file in Selenium (using AutoIT)
How to upload multiple files in Selenium using AutoIT
Guide to perform Drag and Drop in Selenium
Implicit wait in selenium Webdriver
Explicit Wait in Selenium Webdriver
Fluent Wait in Selenium Webdriver
Create custom library to solve sync issues in Selenium Webdriver
Module 3-Selenium Webdriver tutorial
How to capture error message in Selenium Webdriver.
How to Handle Multiple Windows in Selenium Webdriver
How to handle frames in Selenium Webdriver
How to handle Alert in Selenium Webdriver
Handle BootStrap Model Dialog in Selenium WebDriver
How to handle Calender in Selenium Webdriver
How to capture Screenshot in Selenium
Capture screenshots in Selenium using Robot class
How to capture screenshots of failed test cases in Selenium Webdriver
How to use Robot class in Selenium
How to generate log file in Selenium Webdriver using Log4j
What is Webdriver Listener and How to implement Listener in Selenium Webdriver
How to capture tooltip in Selenium Webdriver
How to handle Proxy in Selenium Webdriver
Simple steps to start default Selenium session in Firefox
How to Handle Untrusted Certificate in Selenium or How to handle SSL Certificate in Selenium
How to scroll page in Selenium Webdriver
How to scroll into view in Selenium or Handle particular scroll bar in Selenium
How to get Current System date and time in Selenium
How to run failed test cases automatically in Selenium
Handle Hidden WebElements in Selenium Webdriver (Video)
Module 4- Selenium Webdriver tutorial
How to Execute Selenium test from command prompt
How to download files in Selenium Webdriver.
How to highlight Element in Selenium or Selenium Element highlighter
How to solve Maven issue in Selenium
How to handle Exception in Webdriver
Solution for java.lang.illegalstateexception in Selenium Webdriver
How to handle Element not visible exception
How to Handle Element is not Clickable in x,y coordinate
Solution for sendkeys(CharSequence) in Selenium
How to Handle Stale element reference exception in Selenium Webdriver
How to handle JQuery in not a function exception
Guide to solve Invalid State Elememt Exception in Selenium
How to perform Flash testing in Selenium using youtube API
Difference between findElement and findElements in Selenium Webdriver
How to find broken links in Selenium Webdriver
=================================================
Web Services Testing
=================================================
Selenium Webdriver Tutorial for Beginners
Program to count number of occurrences of word in a string
Nikhil devakar says
Hi mukesh
Can you please make a vedio how to integrate google sheets with selenium(sheets instead of the excel).
Waiting for the reply and vedio.
Thanks in advance.
Mukesh Otwani says
Hi Nikhil, Selenium can only handle web automation so if we need to read or write data from google sheet then we need to use google sheet API for the same. I will try to record video on this soon.
Akhila says
Hi Mukesh,
As part of curriculum, do you also include any desktop automation tool basics and show the integration of both (desktop ans web) in Jenkins?
Thanks
Mukesh Otwani says
Hi Akhila, This course does not cover desktop automation.
Apu says
Hi Mukesh
Thanks for all your videos. Is there any way we can validate the content of the XML and check if the correct data is present?
Mukesh Otwani says
Hi Apu,
For this you may need to use XML parser using which you can validate XML file data
RANJAN V says
Hi Mukesh,
Your videos are very Nice 🙂
Geetha says
Hi Mukesh,
Your videos are excellent & very helpful. Thanks allot for creating such videos & sharing.
Mukesh Otwani says
Thanks Geetha
Sridhar NM says
Could you please add “Handling Single sign on (SSO) in selenium JAVA
Mukesh Otwani says
Hi Sridhar,
Using AutoIT or Robot class, you can achieve it but it is just a workaround
Sai Krishna says
Hai Mukesh your videos were so helpful to learn testing…..and i am getting an exception as Element is not interactable . Please help me to solve such exception
Mukesh Otwani says
Hi Sai,
Could you please try with JavaScript Link http://learn-automation.com/click-in-selenium-webdriver-using-java-script/ and let me know about observations
keshav says
Hi Mukesh,
My Result for the url is like below
{“status”:{“code”:1000,”message”:”SUCCESS”,”timestamp”:1575530291156},”response”:{“OTPValue”:798998}}
I have to capture the otp value and I should pass it .
I am unable to do this .
Thanks in Advance.
Mukesh Otwani says
Hi Keshav,
You need to parse above JSON using any json based library. Please refer this link https://github.com/fangyidong/json-simple
Ankur says
Hi Mukesh,
can your please share the list of java basic interview question so that it will help us cracking the selenium interview??
Thanks
Mukesh Otwani says
Hi Ankur,
Please check this link http://learn-automation.com/selenium-interview-questions-and-answers/
pinki says
Hi Mukesh,
Please help me to learn TestNG and Data Driven Framework.
Mukesh Otwani says
Hi Pinki,
Please refer this link http://learn-automation.com/testng-tutorials-for-beginners/
subha says
I want script for ide but i got question like without recording and playback i want to write the script .
If anyone know this answer plz send to me
Mukesh Otwani says
Hi Subha,
Use Selenium Webdriver which is more advanced than Selenium IDE.
Vijay Kumar says
Hi Mukesh, I would like to know where can I get your full video lessons for selenium web driver application. I saw some of your videos in YouTube, but it missing continuity. Your response will be greatly appreciated. Thanks
Mukesh Otwani says
Hi Vijay,
Please follow below links
1. http://learn-automation.com/selenium-webdriver-tutorial-for-beginners/
2. http://learn-automation.com/advance-selenium-webdriver-tutorials/
3. http://learn-automation.com/jenkins-with-selenium/
Shubham says
hi mukesh,
I had studied most of advance topics from your site and they are most helpful
Mukesh Otwani says
Hi Shubham,
Thanks for your appreciation…:)
Soniya says
Hi Mukesh,
Your Site and videos are very helpful.
Thanks a lot!!!
Mukesh Otwani says
Hi Soniya,
Thanks for your appreciation. You are always welcome to my blog. Please feel free ask your automation related doubts…:)
Amit Sehgal says
Hello Mukesh, Do you have tutorials for JMeter
Mukesh Otwani says
Hi Amit,
Apologies….as of now, I don’t have tutorials for JMeter.
shiva says
Hi mukesh,
do we have any solution to run selenium test cases in parallel?
Mukesh Otwani says
Hi Shiva,
Please check this link http://learn-automation.com/parallel-execution-in-selenium/
Mukesh Otwani says
Hi Shiva,
You can use TestNG to achieve your goal.
kumar says
hi mukesh,
how to download git. Could you please explain briefly.
Thanks,
Sandy
Mukesh Otwani says
Hi Kumar,
Install git on your local machine. Then type git in cmd to check whether it is displaying help commands. Now use got clone
Shiva says
Hi Mukesh,
I am following your selenium videos since long back…. but now i see videos are not in seq or step by step, which is creating so confusion… could you please arrange them in seq so that it it will be helpful for the beginners.
Mukesh Otwani says
Hi Shiva,
You can follow these links to get videos in order
1. http://learn-automation.com/selenium-webdriver-tutorial-for-beginners/
2. http://learn-automation.com/advance-selenium-webdriver-tutorials/
3. http://learn-automation.com/jenkins-with-selenium/
Priya says
hello Sir,
Can you please tell me how to download microsoftwebdriver for windows 8
Mukesh Otwani says
Hi Priya,
Go to link https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ then click releases.
Anbarasu says
Hi Mukesh,
could you please share the video how to automate PDF validation through Selenium WebDriver
Mukesh Otwani says
Hi Anbarasu,
As of now, I don’t have such video but you can refer this link https://pdfbox.apache.org/
Darshan says
Hi Mukesh,
Is it possible to automate sign in test case which has two step verification where we need to enter code from our registered mail ID? Is it possible to skip this test case in selenium? Or any way we can automate this??
Mukesh Otwani says
Hi Darshan,
Selenium purely works on UI. Your query is related to authentication which differs application to application. If there are any APIs available for skip authentication then obviously you can integrate in to same framework.
Rohit says
Can you tell me how to load test cases in ALM using selenium?
Mukesh Otwani says
Hi Rohit,
Apologies…I Never worked on ALM…:(
arjun says
Hello
can u please upload the video for broken images part.
its not there.
thanks much!
arjun
Mukesh Otwani says
Hi Arjun,
I’ll upload it…:)
jyoti says
Explanation is really good. Thank you for providing online study material.
Mukesh Otwani says
Hi Jyoti,
Your appreciation made my day…:)
Keep learning and visiting my blog.
Dheeraj Pratap Singh says
Hi Mukesh,
Current m using firefox version 59 and i am not able to add firebug on it so can you please help me in these. I did try many thing but didn’t succeed. Please help.
Mukesh Otwani says
Hi Dheeraj,
Firebug supports till Firefox version 53. So if you want to use firebug then kindly downgrade firefox.
Kannan says
Hi Mukesh, This link seems empty
http://learn-automation.com/tag/verify-page-title-in-selenium/ . Please make it available.
Your posts was awesome. It was easy to understand. Thanks!
Mukesh Otwani says
Hi Kannan,
Thanks for bringing this concern to me. Somehow few of my blog posts got deleted recently while maintenance. But you can visit my youtube video over here https://www.youtube.com/watch?v=DovuIQ8RojA
I’ll post content the content…:)
priyanka pandey says
http://learn-automation.com/how-to-create-log-files-in-selenium/
In this you have shared can save logs in html file
is it possible to save in xls format.
Mukesh Otwani says
Hi Priyanka,
Log4j is not able to interact with Excel file. In order to log in excel file, you can use Apache POI apis’. For more details, please visit this link http://learn-automation.com/read-and-write-excel-files-in-selenium/
Priyanka Pandey says
Hi mukesh thanks for reply.
http://learn-automation.com/how-to-capture-screenshot-in-selenium-webdriver/
this tutorial video you have mention,adding screenshot in report.please the link.
Mukesh Otwani says
Hi Priyanka,
Here is the link for same http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/
Aayushi says
Hello Sir,
I have write the codr from login window to save form, when i click on save it come to the grid page, after that i click on other its not getting clicking and also not showing any error, i also tried switching window but nothing works. There is no error so i am not getting any to solve it
Mukesh Otwani says
Hi Aayushi,
Did you check the possibility of any frame?
Swapnal Gadekar says
Hi Mukesh,
I have seen your U-tube video for ‘First Testcase in Selenium’ which is very useful for beginners like me.As we can practice simultaneously with scripting.thanks and really appreciated.
Can you please send me link of other similar videos on selenium which are in sequence?
Mukesh Otwani says
Hi Swapnal,
Please follow this link https://www.youtube.com/c/mukeshotwani/playlists
mani says
Hi, Your tutorials are very useful. thanks and really appreciated. sent this comment by my first automation script 🙂
Mukesh Otwani says
Hi Mani,
Very very thanks for your comments. Keep learning…:)
Mohammed says
Hi Mukesh,
Basically application is developed in .net (Visual Studio+C#). So can I use selenium with java to automation this application, If so, what kinda challenges i would face ? Pls Help me
Mukesh Otwani says
Hi Mohammed,
For Selenium, only UI matters. Yes, you can use Java for Selenium.
Ajay says
Hi Mukesh,
Angular Js application Can be handled by Selenium Webdriver?
Mukesh Otwani says
Hi Ajay,
If you are dealing Angular JS application then better to go for Protractor rather than bare Selenium.
KavithaM says
Mukesh can u please tell me like how can i run the testng-failed.xml automatically for a testng class that has so many annotation like @test,@afterclass etc.Where should i run the TestNG runner in the Test class
Mukesh Otwani says
Hi KavithaM,
Yes, you can run it using runner class.
Sachin Patil says
Hi Mukesh,
Can you please tell how stable is selenium with HTML 5, as I want to use it for my project.
Mukesh Otwani says
Hi Sachin,
In HTML 5, few things won’t get automate by Selenium like tooltips on controls as these things are not available into DOM. So you need to accept few exceptions while automating HTML 5 application via Selenium.
priyanka says
Hi Mukesh,
I went through all you post and its really helpfull
Could you please post one more post to integrate selenium with ALM and JIRA?
This is one of interview question ask to me as well as now need to implement in project
Mukesh Otwani says
Hi Priyanka,
In order to integrate selenium with ALM and JIRA we need some API which we dont have.
Still I will try if I will find these API’s then I will let you know 🙂
Sravanthi says
How to verify Page title in Selenium Webdriver
This link is not working
can you please check this
Mukesh Otwani says
Hi Sravanthi,
Thanks for pointing out bugs on my blog. I ‘ll certainly look into this. But for time being, you can visit this stackoverflow link
swetha says
hi mukesh,
I am getting error like “missing artifact com.sun:tools:jar:0” in pom.xml after creating the maven project.
While googling i got to know that it would be pointing to jre instead of jdk.
But i checked it.. it is pointing to jdk itself
could u pls give me the solution.
Mukesh Otwani says
Hi Swetha,
Please send me pom.xml to mukeshotwani@learn-automation.com I will cross check.
Manish Chauhan says
Hi Mukesh
Please Solve the Problem,
The method get(Class) is undefined for the type ExtentReports
Mukesh Otwani says
Hi Manish,
If you are using ExtentReports Version 2.x.x then please refer this link http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/
Harika says
Hi Mukesh,
Your explanation is very nice and easy to understand. Can you please provide explanation on how to debug in eclipse with clear explanation.
Mukesh Otwani says
Hi Harika,
I’ll post it soon…:)
Priya says
Hello sir,
What is org.openqa.selenium.ElementNotInteractableException: erroe an dhow to solve it
Mukesh Otwani says
Hi Priya,
This exception occurs when element is available in DOM but not interactable to driver, like one element overlays another element. In order wait for element of your choice, you can put fluent wait with condition to check for clickability of element of your choice along with ignoring above mentioned exception class. For more info, please check this link http://learn-automation.com/fluentwait-in-selenium-webdriver/
Priya says
Thank in so much sir
Aayushi says
hii,
How to solve unable to locate element error
Mukesh Otwani says
Hi Aayushi,
Check whether element is in frame or not. For more info, please check this link http://learn-automation.com/handle-frames-in-selenium/
Aayushi says
Thanx. its working now
Mukesh Otwani says
Great…:)
Robin Kondra says
Hi Mukesh,
No matter what I try, I am unable to download TestNG. It show a list of errors.
I tried downloading it from the Eclipse Marketplace, some offline down which are available were also tried. Please help me with some alternate solution.
Thanks in advance!
Mukesh Otwani says
Hi Robin,
Have you tried these ways being mentioned in link
Prasanna Raj S says
Hi Mukesh,
May I know what is the clear difference between Robot class and autoIT in uploading files or images in advanced selenium. Even i have to know how to download a image or file using the same and also with basic selenium coding
Mukesh Otwani says
Hi Prasanna,
Robot class deals with keyboard events which works on all OS but Autoit which doesn’t deals with keyboard events works on windows OS only. AutoIT is best option on windows.
Judy says
Hi Mukesh,
Do you have any tutorial for the loop in Selenium? My scenario goes like this, I am creating different legal entity, once clicked CREATE, the next will also do the same and so on.
Mukesh Otwani says
Hi Judy,
For this scenario, use dataProvider or loop it while reading from excel file using Apache POI
Sunny says
I am getting Null pointer exception I did the same things as you did in the POM tutorial and I had mentioned webdriver driver in all the files as the same thing was asked by someone in the comment
plz help
Mukesh Otwani says
Hi Sunny,
NullPointerException is very generic exception which can occur by lot of ways and this is not a selenium specific issue. I would suggest you to debug your code to find where and which object value is becoming null.
Shilpa says
Hello Mukesh,
Requirement: I want to check a proper UI position of an element on page.
So for this requirement I am fetching the (X,Y) coordinates of that specific element and then by assertEquals I am verifying that element is present on that position or not. Ex. Assert.assertEquals(683, HomePageHelpPoint.getX());
Note: Also checking the Y coordinate also.
Problem: The problem which I am facing is that if a single asset fails it stops the execution of test cse. So could you please provide me another solution like if assert fails then I can print a message and can continue with my execution.
Mukesh Otwani says
Hi Shilpa,
Approach 1: You can use try catch block over here. Put your assertion in try block, error message in catch block. This will anyhow make your script execution as success
Approach 2: Use soft assert, here script will get executed till end but script will flag failure finally.
Now it is your choice to go with any approach.
Ashutosh says
I have written the getWindowhandle() method to handle child window , but unable to move the control to child , any solution other than windowhandle method.
Mukesh Otwani says
Hi Ashutosh,
Please check this link http://learn-automation.com/handle-multiple-windows-in-selenium-webdriver/
D.K. Dewangan says
Hello Mukesh Sir,
I have a scenario in automation. That is I have the list of accounts and each account has many projects, So when I go for automation testing, I just want to select an account which I want to check for. But I don’t want to change my code for testing each account. So what can I do?
Help me,
Thanks
Mukesh Otwani says
Hi Durgesh,
You can use the concept of DataProvider. For more info, please go through this link http://learn-automation.com/data-driven-framework-in-selenium-webdriver/
Priya says
Hi Mukesh,
Can you please help me in verifying that text or hyperlink is underlined or not.
Mukesh Otwani says
Hi Priya,
Instead of checking for underline stuff, you can check its href attribute.
Ramesh says
Hi Mukesh,
Please let me know how to find a webElement (List Box) if all the recognition are same without using Xpath and CSS. If possible send the codes.
Thank you.
Mukesh Otwani says
Hi Ramesh,
So in your case, if I am correct, attribute of a property points to multiple nodes. Put all corresponding webelements into a list and iterate it using index.
suneetha says
Hi Mukesh ,
Thanks for reply.
Can you please let me know if 2.53.1 compatible with FF 47.0.2 with out geckodriver
Wanted to know if 3.5.3 is ready to use or not.
Mukesh Otwani says
Hi Suneeta,
I am not sure about FF 47.0.2 with Selenium 2.53.1. Selenium 2 doesn’t require any gecko driver but Selenium 3 needs it. I would suggest you to use selenium 2.53.1 with FF 46.0. Chromedriver should be 2.32
Nitesh says
hi
i have one issue once i click on link one popup will open and oi need to handle that popup by selecting radio button once u select radio button it ll allow me to select dropdown and date how to handle this please help
thanks
Nayak
Mukesh Otwani says
Hi Nitesh,
Check whether pop up is another window or iframe. If not then you can directly apply your required action on controls.
Please go through these links 1 http://learn-automation.com/handle-multiple-windows-in-selenium-webdriver/
2. http://learn-automation.com/handle-frames-in-selenium/
suneetha says
Hi ,
For selenium 2.48.2 which Firefox version supported.
Mukesh Otwani says
Hi Suneetha,
2.48.2 is too old. Use 2.53.1 with FF 46.0. As selenium 3 is still not yet matured fully.
swetha says
Hello sir,
Your blog is so much useful .Its awsome.:)
I am trying to run selenium code , getting this exception :org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Can you please tell me which version of firefox , chrome, IE supports Selenium 3.0 .
Thanks in advance
Mukesh Otwani says
Hi Swetha,
For Selenium 3, firefox and gecko driver should be latest. For chrome, chromedriver should also be latest. IEDriverServer according to Selenium version.
Shilpa Mundra says
Hi Mukesh,
Could you please provide an example for chrome browser with browserstack
Mukesh Otwani says
Hi Shilpa,
Login to your BrowserStack account -> Click on Automate link on top menu -> The click on Resources drop down menu – > Select which language you want -> Then you can see code snippet to connect with BrowserStack
Shilpa Mundra says
hi. I tried to automate it through Java but getting error like
Exception in thread “main” org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: ‘2.43.1’, revision: ‘5163bce’, time: ‘2014-09-10 16:27:33’
System info: host: ‘SGPDWMVDI033599’, ip: ‘10.219.163.242’, os.name: ‘Windows 7’, os.arch: ‘x86’, os.version: ‘6.1’, java.version: ‘1.7.0_40’
Driver info: driver.version: RemoteWebDriver
Could you please tell me why I am getting this error?
Mukesh Otwani says
Hi Shilpa,
Which selenium version are you using?
Ajinkya says
Hi Mukesh,
Thanks for such good tutorial.I just want to know the frequently asked programs in selenium with java interview .If possible please mention all program with code.
Thanks
Mukesh Otwani says
Hi Ajinkya,
I’ll update it with answers…:)
chandrima says
hi Mukesh..
I am some issues while executing the sceenshot command.below is the code.
System.setProperty(“webdriver.chrome.driver”,”D:\\Selenium\\chromedriver.exe”);
WebDriver driver = new ChromeDriver();
driver.get(“http://google.com/”);
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere
try {
FileUtils.copyFile(scrFile, new File(“c:\\tmp\\screenshot.png”));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and the error is:-
Starting ChromeDriver 2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9) on port 21872
Only local connections are allowed.
Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
Please tell me where i am doing wrong.
Mukesh Otwani says
Hi Chandrima,
Please Use chromedriver 2.31
Priya says
Hi Mukesh,
I have a general question.This is asked in one interview in System.setProperty(“webdriver.chrome.driver”,”fielpath.exe”)
we have provided .exe, does this means selenium interacts with desktop based appins?
Thanks in Adavance
Mukesh Otwani says
Hi Priya,
This doesn’t mean that you are going to interact with desktop based applications in straight way but it is nothing more than setting an environment variable temporary so that it can call web browser instance which helps webdriver instance to interact. It is like setting java path in environment variables.
Bhoomika says
Hello Sir,
i am not from it background , right now i am working as a manual tester. i am learning automation from your video tutorial.
it’s so much easy to understand thanks for this.
but i have one question ,
can you please tell me how to find Xpath without using firebug?
how to write xpath with help of inspector ?
Mukesh Otwani says
Hi Bhoomika,
Please refer this link http://learn-automation.com/how-to-write-dynamic-xpath-in-selenium/
bhavana singh says
Hi Mukesh,
I don’t know how to thank you because your selenium video’s made my Selenium learning so easy. Thanks a ton. You are the best teacher and your knowledge on automation and generosity to share it is commendable. After this will definitely enroll for your framework course also. Keep up doing a good job.
Mukesh Otwani says
Hey Bhavana,
Greeting of the Day !!
Your most welcome and keep learning and thank a ton for such a nice feedback.
Feel free to call for any query in framework course if any +91-8123547984
Thanks
Mukesh
Uma mahesh says
Unique destination to Automation…👌👌👌
I’m very much impressed to your tutorials… simply pin point explaination.
Can I get your tutorials PDF copy ?
Mukesh Otwani says
Hi Uma,
Very very thanks for your appreciation.
But sorry to say, I don’t keep pdf version of posts.
mahendran says
Awesome blog!!!
Mukesh Otwani says
Hi Mahendran,
Thanks for your comments…Be in touch…:)
sonali says
hello sir,
how to avoid “Do you want google chrome to save your password for this side” message.
Mukesh Otwani says
Hi Sonali,
Please check this link https://stackoverflow.com/questions/43223857/save-password-for-this-website-dialog-with-chromedriver-despite-numerous-comm
Amol Padwal says
Hi Mukesh,
Thanks for all tutorial i am new in automation and relay all this tutorial are helpful for me. i would like to learn selenium from scratch so please guide me, how much java required for selenium and which java topic are impotent for selenium so i will concentrate on those topics first.
Mukesh Otwani says
Hi Amol,
Java is like ocean, how much you dive that much you learn. And frankly there is no specific topics of Java which are being used for automation script. I would suggest you to learn Java first https://www.javatpoint.com/java-tutorial
Rajini says
Hello Mukesh sir,
Good evening ,
i have knowledge on java , i would like to learn selenium from basic it self.
i have seen ur videos but am getting confuse from where should i start could you please advise from which video i should start step by step procedure.
thanks.
Rajini
Mukesh Otwani says
Hi Rajini,
First you can go through the topics being mentioned here http://learn-automation.com/selenium-webdriver-tutorial-for-beginners/
then go for topics over here http://learn-automation.com/advance-selenium-webdriver-tutorials/
Mohit says
how to handle radio buttons with same properties and even same name. and suppose i want to click one radio button
Mukesh Otwani says
Hi Mohit,
Using common locator property, read all webelements into a list and iterate it to certain index which you want.
Imran says
Hi Sir,
Thanks for the materials which you have provided. I got lot of help from these resources of yours and have recommended this site to many of my friends.
Actually i have a question for which i did n’t get correct/exact answer from anyone. Could you please help me out with this. here is my Query.
-> We have developed our site using Angular js and we are facing issues with waits as none of the waits are working with our app except Thread.sleep but we have lot of dynamic content so it’s not advisable to use thread.sleep but we don’t have any other option. Could you please confirm if this is true that other wait functions will not work with Anjular js apps and is using Protractor the only solution to avoid wait issues or this can be handled by using some custom wait functions ?
Mukesh Otwani says
Hi Imran,
Selenium itself is not able to handle angular js application that’s why Google brought Protractor into market. Protractor also gives you extra locators apart from 8 locators being provided by Selenium as Protractor is a wrapper over Selenium APIs. If your application is built on angular js than I would suggest you to go for Protractor for automating your application.
Surbhi says
Hii
Mukesh sir
I m getting -FAILED: mouseHover
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {“method”:”xpath”,”selector”:”.//*[@id=’ui-id-24′]/a”}
For the below code, plz suggest me the mistake
package Module2;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;
public class Mousehover_clickonWebelement {
@Test
public void mouseHover() throws InterruptedException{
System.setProperty(“webdriver.chrome.driver”, “src\\chromedriver.exe”);
WebDriver driver = new ChromeDriver();
driver.get(“http://bestfoodplaces.com/”);
driver.manage().window().maximize();
Thread.sleep(5000);
driver.findElement(By.id(“rest_name”)).sendKeys(“pla”);
Thread.sleep(3000);
WebElement ele= driver.findElement(By.xpath(“.//*[@id=’ui-id-24′]/a”));
ele.click();
Actions select = new Actions(driver);
select.moveToElement(ele).build().perform();
Thread.sleep(2000);
select.click(ele).build().perform();
}
}
Mukesh Otwani says
Hi Surbhi,
First you need to handle login window pop up and check with the xpaths being used in code.
Ashwini says
Hi…
I am trying using List for counting all links on webpage. But getting an error “Remove type argument”.
Code written:
List links= wd.findElement(By.tagName(“a”));
Mukesh Otwani says
Hi Ashwini,
wd.findElement(Locator) returns a WebElement and wd.findElements(Locator) returns a list of WebElements.
Hitendra says
Hi,
Mukesh,
as i have created xpath but in selenium it is not working and not select the value from the drop down.
//div[contains(@id,ui-id-i)]/select
Mukesh Otwani says
Hi Hitendra,
Just with some xpath, it is impossible to say about what kind of drop down you are dealing with. I would suggest you to go through below mentioned two links. First link works with select tag which you can observe in corresponding post.
1. http://learn-automation.com/handle-dropdown-in-selenium-webdriver/
2. http://learn-automation.com/handle-bootstrap-dropdown-in-selenium-webdriver/
Kavya Bachimanchi says
Can u tell me how we can use this selenium on Mobile
Mukesh Otwani says
Hi Kavya,
Please refer these links
http://learn-automation.com/appium-tutorial-for-beginners/
http://learn-automation.com/automate-native-applications-using-appiumselenium/
Amol Padwal says
Hi Mukesh,
This for selenium tutorial, Its really helpfull for beignrrs as well as experienced person. Just i have a small request it difficult to find “Selenium Webdriver tutorial for beginners” page on a website. if you create tutorials tab then it good for easily navigate to the tutorial page.
Thanks.
Mukesh Otwani says
HI Amol,
Thanks for your constructive comment. I’ll surely do it in my blog…:)
Deepika says
Hi Mukesh,
In the dropdown i have few values like a,b,c and — and c,d,e.
I want to select all the dropdwon values except –.How to do this. If i use getOption method it will display all options including –. If i use if condition like if text == — and put break it will come out of loop.it will not display rest of the options. Please suggest me on this.How i will do this?
Mukesh Otwani says
Hi Deepika,
WebDriver will bring everything whatever locator property being provided. We need to handle by our login to remove unwanted data. In your case also, whenever you get all options of dropdown then we remove ‘-‘ from list. And wrt to break statement, please try to debug your code.
Rakshith says
Hii Mukesh,
how to identify the elements which id’s keeps on changing.
Suppose id=ab_123 and 123 changes to 456 etc…
how to identify such elements..please help me
Mukesh Otwani says
hi Rakshith,
Try with dynamic xpath with keyword ‘starts-with’. For detailed information, please check this link http://learn-automation.com/how-to-write-dynamic-xpath-in-selenium/
prateek says
hi,
i am using below code to take screenshot.
package capturescreenshot;
import java.io.File;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class CaptureSS {
WebDriver driver;
@Test
public void captureS() throws Exception{
System.setProperty(“webdriver.gecko.driver”,”C:\\Users\\prateek.sharma\\Downloads\\selenium\\geckodriver.exe”);
driver=new FirefoxDriver();
………………..
===============================================
Default test
Tests run: 0, Failures: 0, Skips: 0
===============================================
can you please advise what could we the issue??
thanks
Mukesh Otwani says
Hi Prateek,
Import testng.annotation library instead of junit.Test
Roupya says
Hi Mukesh
I am getting ” java.lang.NullPointerException”
for the below code, please suggest what the mistake
public class Capture
{
public WebDriver driver;
public int i;
public void takeSnap()
{
try {
File srcFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
File destinationFle = new File(“./reporter/img.png”);
FileUtils.copyFile(srcFile, destinationFle);
}catch (IOException e) {
System.out.println(“Some exception”);
e.printStackTrace();
}
}
@Test
public void startExecution()
{
Capture c=new Capture();
System.setProperty(“webdriver.chrome.driver”, “./drivers/chromedriver.exe”);
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get(“http://learn-automation.com”);
System.out.println(driver.getTitle());
c.takeSnap();
driver.quit();
}
}
Mukesh Otwani says
Hi Roupya,
While invocation of takeSnap() method, driver object becomes null. Two ways…Either pass driver object to this method or make driver object as static during its declaration.
Harika says
Hi Mukesh,
You are doing a greate job.
This is my testng program, and when i try to run this program getting bellow error message.Please help me in running the testng program.
Eclipse-3.8.3, java 8, testng jar files : testng-6.8.7.jar , testng-6.8.7-sources.jar
package testng;
import org.testng.annotations.*;
public class TestngDemo {
@Test
public void test()
{
System.out.println(“Hello,this is sample testNG program”);
}
}
Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.NoClassDefFoundError: com/beust/jcommander/ParameterException
Mukesh Otwani says
Hi Harika,
I am not sure about Eclipse 3.8.3. It would be better if you use latest Eclipse along with testng jar of version 6.9.10(http://central.maven.org/maven2/org/testng/testng/6.9.10/testng-6.9.10.jar) and don’t use existing one
Deepak Gupta says
How to handle sub child windows(more than 3) using Selenium Web Driver with Java
Mukesh Otwani says
Hi Deepak,
In case of more than 2 windows, switch driver to each window bi iteration and verify title or any other specific property from window. If it matches the required window then stay on it otherwise do same on next window.
Mit says
Superb blog !!!!
Thank you very much Mukesh 🙂
Mukesh Otwani says
Hi Mit,
Feeling pleased to read from you. Be in touch..:)
Babu says
Hi Mukesh, Can u Show me how to Re Run the Failed TestCases at suit level for all the test cases? or Refer me any Reference
Mukesh Otwani says
Hi Babu,
Please check this link http://learn-automation.com/execute-failed-test-cases-using-selenium/
mannu says
Hi Mukesh,
How do I acess ur Blog??Need to know the concepts related to Xpath.Please help me with the link.
Mukesh Otwani says
Hi Mannu,
Please refer these links http://learn-automation.com/how-to-write-dynamic-xpath-in-selenium/
http://learn-automation.com/write-dynamic-css-selector-in-selenium/
Anil Ransing says
Hi Mukesh,
I am a big fan of your Selenium WebDriver blog, reading and following you since 2 years.
Currently I am trying to automate one of application which is build in Vaadin framework as a result I am having too many problems. The main issues are Vaadin application use only classes, there is no id, name or other elements, secondly, it has a syncing issue, I have tried all waits but it didn’t work reliably. there are other issues related to DOM as well.
Kindly, if you know how to automate Vaadin application using selenium WebDriver (no testbench) then please post some articles on it.
Thanks in advance.
Anil
Mukesh Otwani says
Hi Anil,
Sorry to say, but I never worked with Vaadin Framework.
Ann says
Hi Anil,
Where you able to automate your Vaadin application using Selenium? I’m truing to do the same with robot framework and I find some issues in between. Though I try to extract xpath, it doesn’t locate all the elements.
Thanks,
Ann
sumit vani says
Hi, I am facing trouble to click on google map auto suggest location , I have select one suggestion.
Mukesh Otwani says
Hi Sumit,
Please check whether you can see those suggestions in DOM structure too.
Nikhil says
I am start to learning selenium from basic to advance & I want to become complete package for automation.
what it the sequence of learning ?
Request you to Kindly upload the video for practical example..
Thank You..
Mukesh Otwani says
Hi Nikhil,
I’ll do it soon…:)
Dinesh Guptha Sivaguru says
Hi Mukesh,
I could see only 10 videos in “Java Videos on YouTube “.Is this enough to start learning selenium with these 10 basic JAVA concept or will you post more video on JVA topics?
Mukesh Otwani says
Hi Dinesh,
These videos are for basic learning but covering everything for Selenium and Java is very huge topic. But very soon I’ll post more videos on this topic.
Dinesh Guptha Sivaguru says
ok Thanks for your reply:)
Ashwary says
Unable to locate element:
org.openqa.selenium.NoSuchElementException: Unable to locate element: {“method”:”xpath”,”selector”:”html/body/div[1]/div[2]/section/div[1]/div/div[2]/section[2]/div/form/div[42]/div/div[1]/textarea”}
Command duration or timeout: 377 milliseconds
why this problem always comes…..i m fed up by this…….i tried every thing mukesh…
Mukesh Otwani says
Hi Ashwary,
Try with another locator method.
Ash says
plz help ,close function is not working
public class Urbille12sprint {
WebDriver d;
@Test(priority=1)
private void closeBrowser() {
d.close();
}
}
Mukesh Otwani says
Hi Ash,
Call d.quit()
Imroz Ansari says
Hi Sir I want know. why are my code is not run ,It want to run gmail properly login .I m using xpath plz check the error .My problem in enter the password using xpath
public class LaunchGmail {
public static void main(String[] args) {
System.setProperty(“webdriver.gecko.driver”,”F:\\gecodriver\\geckodriver-v0.15.0-win32\\geckodriver.exe”);
WebDriver driver = new FirefoxDriver();
driver.navigate().to(“https://accounts.google.com/ServiceLogin#identifier”);
driver.findElement(By.xpath(“//input[@id=’Email’]”)).sendKeys(“imran@finesofttechnologies.com”);
driver.findElement(By.xpath(“//input[@id=’next’]”)).click();
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS) ;
driver.findElement(By.name(“Passwd”)).sendKeys(“xyz”);
//driver.findElement(By.xpath(“//input[@id=’signIn’]”)).click();
}
}
Mukesh Otwani says
Hi Imroz,
Your code is working fine for me. The only difference is that I ran your code with Selenium 2.53.1 with FF 46.0.
sunanda says
Hi mukesh
Actually i am not getting how to take find element from this “onclick=”javascript:CallSaveUserDetails(‘2091′,’abcd’,’true’); return false;”
Can u please help….
Mukesh Otwani says
Hi Sunanda,
There should be a tag in which this statement resides. Try to use that tag for locator
Koteswari says
hi, Mukesh,
Could you post the steps to run selenium script over the VPN client.
Mukesh Otwani says
Hi Koteswari,
VPNs’ are usually used in organizations. And I don’t have my own VPN connectivity. You can login to VPN machine, clone your scripts and run it from there. If you are running it from your machine it requires authentication recognition for security token and network proxy.
deepak says
Hi mukesh, I trying with code that in case of fail it wirte in excel “Fail” but always it write pass. if title not match. please suggest.
public String verify_Title(String object, String data)
{
APP_LOGS.debug(“calling copareTitle function”);
String actual_title=driver.findElement(By.xpath(OR.getProperty(object))).getText();
System.out.println(actual_title);
String expected_Title=OR.getProperty(data);
System.out.println(expected_Title);
try{
if(actual_title.equals(expected_Title)){
System.out.println(“Title matched”);}
}
catch(Exception e){
return “Fail”;
}
/* else{
System.out.println(“Title not matched”);
}*/
return “PASS”;
}
Mukesh Otwani says
Hi Deepak,
There is small mistake in the login implemented over here. Here you are returning “PASS” at end of method which will always return “PASS” in any circumstances. Put this return statement inside try block.
TuanNguyen says
Hi Mukesh Otwani, Lessons are very useful. Can you show me how to get elements that template bindings ? Thank in advance.
Mukesh Otwani says
Hi TuanNguyen,
Could you please elaborate…
Babu says
Hi Mukesh.. Thanks for Maintaining this Helpfull Blog. Coming to point.. can you share a concept to read Input data from XML file like data driven
Mukesh Otwani says
Hi Babu,
You can refer these links
1. https://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/
2. https://www.mkyong.com/java/how-to-read-xml-file-in-java-sax-parser/
praveen says
Hi Mukesh,
I want to capture Employers drop down (top right side of the page) and click on any one of the drop down values in monsterindia.com web page. But i am getting error. ( org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted). can you please help
Below is the code:
driver.get(“http://www.monsterindia.com/”);
Actions builder=new Actions (driver);
WebElement employee=driver.findElement(By.xpath(“.//*[@id=’empuser_wrap’]/div/div/a”));
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS);
builder.moveToElement(employee);
driver.findElement(By.xpath(“.//*[@id=’empuser_wrap’]/div/div/div[1]/ul/li[1]/a”)).click();
Mukesh Otwani says
Hi Praveen,
Use it this way….
driver.get(“http://www.monsterindia.com/”);
Actions builder=new Actions (driver);
WebElement employee=driver.findElement(By.xpath(“//*[@id=’empuser_wrap’]/div/div/a”));
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS);
builder.moveToElement(employee).build().perform();
driver.findElement(By.xpath(“//*[@id=’empuser_wrap’]/div/div/div[1]/ul/li[1]/a”)).click();
FYI: Use Selenium 2.53.1 with FF 46 as Selenium 3.x.x has issues with Actions class
Manjusha says
Hi mukhesh,
when i was trying to inspect element browser should display html,css,script,DOM,Net,Cookies. But my browsers are displaying console,sources,network,timeline,profiles,Application etc. Do I need to change any settings here?
Mukesh Otwani says
Hi Manjusha,
This is what web browser developer tool shows. I am also getting Elements, Console, Sources, Network, Timeline, Profiles, Application, Security, Audits tabs.
Mahul says
Hello Mukesh,
I am trying to launch the chrome driver using selenium webdriver but not able to launch. I am getting below error message:
[4880:4732:0315/231144.005:ERROR:cache_util_win.cc(20)] Unable to move the cache: 5
[4880:4732:0315/231144.005:ERROR:cache_util.cc(134)] Unable to move cache folder C:\Users\Mahul\AppData\Local\Google\Chrome\User Data\ShaderCache\GPUCache
And my CODE is:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Test1 {
public static void main(String[] args) {
System.setProperty(“webdriver.chrome.driver”,”C:/Program Files (x86)/Google/Chrome/Application/Chrome.exe”);
WebDriver d = new ChromeDriver();
d.get(“http://www.seleniumhq.org/download/”);
d.quit();
}
}
Please help me.
Mukesh Otwani says
Hi Mahul,
If you are using Selenium webdriver then you need to provide chromedriver.exe path from you local machine not the chrome.exe path which comes when you install Google Chrome. You can download chromedriver.exe from thsi link http://chromedriver.storage.googleapis.com/2.28/chromedriver_win32.zip
Anusha says
Hello Mukesh , I am learner of selenium web driver. I was trying to write a code in eclipse for a scenario, which i was unsuccessful.
Scenario:
ive an excel sheet with values as below :
Y http://www.newtours.aut.com Welcome tours (page title)
i wan to write a code if datatorun is equal to Y then navigate to the url in the sheet , verify the page title with the actual one and print the result as pass or fail in excel sheet.
Can you help me with this
Mukesh Otwani says
Hi Anusha,
Create a logic like one outer loop which will iterate excel sheet one by one. Column index is fixed for each stuffs. Here first check, either ‘Y’ or ‘N’, if ‘Y’ then read url from next next column and pass this url as argument to method which can call driver.get(“—–“) and this method should return page title. Now compare this actual title with data available inside excel on same row but different column. And if, first check is ‘N’ then iterate row count i.e. outer loop.
Dinesh Guptha Sivaguru says
Hi Mukesh,
When I tried the below steps with casting, I got negative value….could you please explain this concept
byte by=(byte) 151;
System.out.println(“the new byte value is”+by);
The result is : -105
Mukesh Otwani says
Hi Dinesh,
Please check this link
Dinesh Guptha Sivaguru says
Sure will check….Thanks
Mukesh Otwani says
Hi Dinesh,
Sure….
Megha says
Can you give me a example how to use property file and how to use it in selenium web driver. How to use property file for showing result in website. In all examples they showed result running in command prompt
Mukesh Otwani says
Hi Megha,
I hope this link will help you alot
ram says
Hi, sir i have doubt how to use apachi poi for reading and writing data in excell sheet
Mukesh Otwani says
Hi Ram,
Please check this post http://learn-automation.com/read-and-write-excel-files-in-selenium/
and let me know about this.
sonali says
hello sir,i want to ask you one question that if there are multiple ok buttons lets say 100 on webpage how will you click on second last ok button.
Mukesh Otwani says
Hi Sonali,
If the buttons are also in same order in DOM as that of ui then find locator which can provide you all buttons. Put them in a list and iterate from backwards.
Sravan says
Hi Mukesh,
Please update the selenium webdriver videos in order
Mukesh Otwani says
Hi Sravan,
Thanks for pointing this, even lot of my blog visitors are demanding same thing. I’ll do it soon.
Amit says
Hello Mukesh.
i am facing issues in running the selenium programs, FF is opening , but its throwing below error in console exiting the program. looks like some configuation issue.
Firefox verison : 51 ( latest )
selenium : 2.41
i am trying to run the old script using the latest FF i am seeing this issue.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.
Mukesh Otwani says
Hi Amit,
Selenium 2.41 doesn’t support FF 51. Use selenium 3.1 with geckodriver for FF 51. For more details, please refer this link http://learn-automation.com/use-firefox-selenium-using-geckodriver-selenium-3/
Prasad says
Hi Mukesh Sir,
How to run Selenium automation script in web server, since server not hosting any browser( I do have selenium script in local machine wanted to host this script in web server to run remotely)
Mukesh Otwani says
Hi Prasad,
You can use Selenium Grid for this. Please have a look on this post http://learn-automation.com/selenium-grid-for-remote-execution/
Sorathiya Paresh says
Hi Mukesh ,
Can we customise settings in chrome developer tool using capabilties for browser
Mukesh Otwani says
Yes, Sorathiya..
You can do some customize setting but upto certain extent. For more details, refer these two links https://sites.google.com/a/chromium.org/chromedriver/capabilities
https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html
Megha says
Hi,
You said Firefox is a default browser for Selenium IDE, but it does not support support for java 1.7 and selenium 2.53. Or does it support firefox. If so ? can you explain me how to do that.
Mukesh Otwani says
Hi Megha,
Which version of FF are you using?
Maheswaran says
How to handle http://only-testing-blog.blogspot.in/ in iframe i feel to difficult please help me.
Mukesh Otwani says
Hi Maheswaran,
Please check this link–> http://learn-automation.com/handle-frames-in-selenium/
Garima says
Hi Sir,
Is all these topic that have you mentioned for Basic and selenium webdriver Advance are enough to crack any interview.
Mukesh Otwani says
Hi Garima,
In my opinion, these topics covers most of the portions but it all depends on interviewer knowledge also. Knowledge always comes when you involve yourself in real times automation of applications and how you are able to bring client/stakeholders requirements into your project. No doubt, these topics will help you alot for your interview preparations.
Anyway, best of luck for your interview…:)
Jyoti says
Hi Sir
Can you suggest me some Link for learning about How Regression Testing can be done for a project with some practical examples
Mukesh Otwani says
Hi Jyoti,
Regression test happens when tester get new application build with some code fix and some enhancements so that previously working functionality should work fine.
Jyoti says
if we click on save button without entering any of the textbox filed and if that textbox field is mandatory then it asks for validation like Enter first name..for such kind of registration page how can we write test cases?
Mukesh Otwani says
Hi Jyoti,
Please check this link http://learn-automation.com/capture-error-message-in-selenium/
Jyoti says
Hi Sir.
Have You uploaded the video to Test a Simple Registration Page which includes First Name,Last Name,Mobile Number,Email-Id with its proper validations for a textbox fields using Selenium WebDriver…If Yes, Let me Know the URL or website of it..
Thanks In Advance.
Mukesh Otwani says
Hi Jyoti,
I didn’t post such video. But tell me, what do you mean by validations for these fields.
Mukesh Otwani says
Hi Snehal,
You forget to set gecko driver path.
Sorathiya Paresh says
hi Mukesh
How can we automate opening the chrome developer tool.
Mukesh Otwani says
Hi Sorathiya,
If you want to enable developer tool, then yes you can do it using keyboard events but automation of developer tool is not possible using Selenium APIs.
Jyoti says
Hi Sir,
Can you Please Post the video for How can we test a simple Registration page which includes First Name,Last Name,Mobile Number,Email-Id with its proper validations for a textbox fields…
Your Previous replies Helped me alot..Thank you for that sir..
Mukesh Otwani says
Sure…:)
Jyoti says
Can we write code to check whether the Right Click is disabled or not for the page using selenium webdriver?
Mukesh Otwani says
Hi Jyoti,
Selenium library provides right click operation using Actions class (contextClick). After this operation, you can verify whether menus are displayed or not.
Jyoti says
Hi Sir,
how to check whether a textbox accepts special characters ot not using selenium webdriver..And how to check the validation for Mobile Number using Selenium webdriver..
Please let me khow the answer for these two questions..
Thanks in Advance
Mukesh Otwani says
Hi Jyoti,
There is no answers for these two questions from Selenium APIs. Selenium can pass data as String to required fields and in same way it can read data from fields. Once you get data, process it using Java and validate by your own choice.
Nishant Kumar says
How to check the presence of element on the Webpage. I have to check whether the element is present or not on Webpage for a textbox and after that print the value shown in the textbox
Mukesh Otwani says
Hi Nishant,
You can use isDisplayed() over here. If it returns true then you can proceed for next action/operation.
Been says
Dear Mukesh! Hello and thank you from Germany. Where do I post general queries? E.g. regarding nullpointerexceptions etc.?
Mukesh Otwani says
Hi Been,
NullPointerException are generic exceptions from Java, you can post your doubts under corresponding topics.
Balal says
Hi Mukesh,
Could you please provide the complete code for Data provider example for more than 50 users login to the FB/Gmail.
Thanks in advance.
Mukesh Otwani says
Hi Balal,
In this case, it is better if you read these data from excel using Apache POI(http://learn-automation.com/read-and-write-excel-files-in-selenium/)because right now it is 50, what if it is 500.
pooja says
Hi Mukesh,
Can you please provide some idea on load testing using JMeter and junit to automate the scripts.
Mukesh Otwani says
Hi Pooja,
Right now, I don’t have any post specific for JUnit and JMeter.
swati nehete says
Hello Mukesh
Very Very Nice Work. I learnt alot from you java and selenium tutorial. It helped me alot. Thank you so very much.
Mukesh Otwani says
Hi Swati,
Its nice to read from you.
Chetan says
Hello,I want to develope Hybrid framework…So please give me any idea for developing framework or any video available belong to Hybrid framework
Mukesh Otwani says
Hi Chetan,
You can use this link http://learn-automation.com/page-object-model-using-selenium-webdriver/
Swopna says
Hi Mukesh,
I have jave knowledge, but not having Selenium knowledge. I am referring your all videos,all videos are awesome . Can you suggest me one book. I want to prepare for Interview for Selenium.
Mukesh Otwani says
You can subscribe to my newsletter and you will get all Q&A
sonali says
how to create test suit
Mukesh Otwani says
Hi Sonali,
Kindly refer this post http://learn-automation.com/group-test-cases-in-selenium/
pranav says
package apacxhe;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class excell2 {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
File f = new File(“C://Users//user//Desktop//tests data.xls”);//it is file path
FileInputStream fis=new FileInputStream(f);
XSSFWorkbook wb=new XSSFWorkbook(fis);
XSSFSheet Sheet1 =wb.getSheetAt(0);
Sheet1.getRow(0).createCell(2).setCellValue(“Pass”);
Sheet1.getRow(1).createCell(2).setCellValue(“false”);
FileOutputStream fout=new FileOutputStream(f);
wb.write(fout);
wb.close();
}
}
sir, this is my program and i am getting this
Exception :-
Exception in thread “main” java.io.FileNotFoundException: C:\Users\user\Desktop\datadriven.xls (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at apacxhe.excell2.main(excell2.java:15)
Mukesh Otwani says
Hi Pranav,
Somewhere your file object f is referencing a file on path(C:\Users\user\Desktop\datadriven.xls). Kindly check this file object.
gowtham says
Actually i want to automate a multi window handle,but by using windowHandles() it has giving partial output.is it any other way is possible to autmate same???
Mukesh Otwani says
Hi Gowtham,
Could you please explain what is partial output?
Tej says
Hi Mukesh
Can you please explain about TRIRIGA Testing
Mukesh Otwani says
Hi Tej,
TRIRAGA looks like some Real Estate & Facility Management related application from IBM. As of now, I am not providing anything which is related to functional/specific domain related knowledge. You are always welcome to ask your doubts wrt technical stuffs for automation.
Roup says
Hi Mukesh
Could you please share post or video regarding the below topic:
“How to read data from csv file using data provider in selenium webdriver”
Mukesh Otwani says
yes will do soon
rajesh says
Hi Roup,
You can read this article from Selenium SITE
https://learn-selenium-automation-testing.blogspot.in/2016/12/read-data-from-properties-file-using.html
Mukesh Otwani says
Hi Rajesh,
Thanks again…:)
rajesh says
Hi Roup,
You can check data driven framework with dataprovider in selenium webdriver with below url
https://learn-selenium-automation-testing.blogspot.in/2017/01/selenium-data-driven-framework-step-by-step.html
Mukesh Otwani says
Hi Rajesh,
Thanks for guiding Roup.
Dipal says
Hi
How to create framework for web application? I am new for selenium and want to learn to create web application framework using selenium.
Mukesh Otwani says
Hi Dipal,
Please visit this link http://learn-automation.com/page-object-model-using-selenium-webdriver/
Geetarani Mishra says
Hi Mukesh,
Thank you sooo much for your effort, for making professionals to learn automation testing.It’s simply superb and I am a fan of yours.
Mukesh Otwani says
Thanks Geetarani 🙂 I am glad to read your comment. Keep in touch and let me know if any help from our side.
murli bagare says
Hi Mukesh,
all your videos are awesome ..
can u please guide me how to automate static pages of website.
Mukesh Otwani says
Hi Murli,
What do you mean by static pages? Selenium automate browser it can be static and dynamic too.
Roup says
Hi Mukesh,
Your Blog is really useful as I am new to selenium and Thank You so much for sharing knowledge.
I have one question.
Can we use more than one DataProvider using TestNG ?
Mukesh Otwani says
Hi Roup,
Yes, you can have multiple dataprovider but you can use one at a time.
sid says
hii.. i have a query.. i have been locating the elements manually using xpath and other things and i have able to write and execute programs using eclipse.. my doubt is that for wat i shud used selenium IDE 2.5.0 ??
Mukesh Otwani says
Hi Sid,
If you are using Selenium IDE for locating elements then there is no need for doing this. Without Selenium IDE it is possible.
DARSHANKUMAR says
Hi Mukesh,
Please help me with this.
While using WebDriver interface it is showing error like WebDriver cant not be resolved to a type. How to handle this?
Mukesh Otwani says
Hi Darshan,
Please make sure that you do not have any class which named as WebDriver
Pranay says
Hi Mukesh,
I will be very grateful to you for creating such a learning plateform of automation. Thanks a lot for this.. Suppose the test application is sending emails,then can we test this using selenium? If yes, then please provide the tutorial for this.
Mukesh Otwani says
Hi Pranay,
Yes every email application has some API which will help you to automate the overall functionality. Kindly check below link https://developers.google.com/gmail/api/
Manasa says
Hi sir..,
Most of the companies will ask selenium with C# so will u share the videos. i am new to the C#
Mukesh Otwani says
Hi Manasa,
I will also post soon. As of now you can refer below blog http://executeautomation.com/blog/selenium-automation-with-c/
hemant says
Hi Mukesh I am referring your site,its really helpful and clear my concept …Thanks for providing such content for free.
Mukesh Otwani says
Your most welcome hemant and really appreciating your learning towards Selenium.
Anusha says
Mukesh, have you added any video for finding independent and dependent xpath
Mukesh Otwani says
Hi Anusha,
You can check below link http://learn-automation.com/how-to-write-dynamic-xpath-in-selenium/
Sangram says
Hi Mukesh,
This is Sangram..
do we test Database using selenium?? like logged in database and search value from table or tally those from table data with application data?
Mukesh Otwani says
Hey Sangram,
Here we go http://learn-automation.com/best-guide-for-database-testing-using-selenium-webdriver/
abhijeet says
can you prepare video about hybrid framework which has
2 test case
2 excel sheet
and that two test cases capture data from two different excel sheet.
i tried a lot but i am able to read data for only one test case.
Mukesh Otwani says
Yes Abhijeet sure I will do that.
Amar says
I want to master in selenium webdriver,
plz suggest me
I go through no. of vedios on youtube
but i think ur vedios is osm for learning selenium
It can be enough to watch ur all vedios for selenium webdriver…???
Mukesh Otwani says
Hi Amar,
Yes it will help but you also have to put so much effort for this.
archana says
Do you have any project for the practice? Where we can do more practice, where can develop 30-35 testcases then integrate with framework , generate report like this???
Mukesh Otwani says
Hey Archana,
Try to automate below app with different modules.
http://enterprise.demo.orangehrmlive.com/symfony/web/index.php/auth/login
sanjay vaish says
Hi Mukesh,
Nice blog …
can u help me for my query
System.setProperty(“webdriver.gecko.driver”, “D:\\geckodriver-v0.11.0-win64\\geckodriver.exe”);
WebDriver driver = new FirefoxDriver();
System.setProperty(“webdriver.ie.driver”,”D:\\IEDriverServer_x64_2.53.1\\IEDriverServer.exe”);
WebDriver driver1=new InternetExplorerDriver();
//To click on login button
driver.get(“http://192.168.11.53:8089/DedupeDRSUAT/”);
driver.findElement(By.xpath(“id(‘btnlogin’)”)).click();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get(“drs.htm?role=9”);
//To click on logout button
driver.findElement(By.xpath(“.//*[@id=’logout’]/a/u”)).click();
driver.close();
The above code is works perfectly fine for my Mozilla browser, but when i try for IE11 bowers the logout link doesn’t work, it is only opening site and get stuck
Mukesh Otwani says
Hi Sanjay,
I checked your code and found you have not used driver1 that is the reason it is not performing any action.
Meenakshi Agarwal says
It’s indeed an excellent roundup of the important Selenium articles. Your youtube videos are also quite helpful. Thanks.
Mukesh Otwani says
Hey Meenakshi,
Thank you so much 🙂 Happy Diwali to you and your family.
Mayur says
Hello Mukesh Sir I am new to selenium world.I want to be master in selenium. Tell me where to start from.Thanks in advance
Mukesh Otwani says
Hi Mayur,
You can start from below video playlist
Kiara says
Thanks so much Mukesh.. Your blog is very informative for the starters in automation…
Mukesh Otwani says
Thanks Kiara keep visting.
Srinivasa says
This is very useful for beginners, now i am working as manual tester, planning to move to selenium, this is very useful tutorial
Mukesh Otwani says
Thanks Srinivasa 🙂 Keep visiting.
Anandh says
Hi Mukesh,
Your tutorial is very useful and very clear for beginners. I have doubt in XML comparison. Is there any possible to compare to XML file and display a result whether XML is same or not.
Devi says
Hi mukhesh,
I’m searching job on testing.I have .net developer background.I have seen loads of videos in youtube.But confusing where to start and where to end.confusing????Plz give me guidence how to get job on testing
Mukesh Otwani says
Hi Devi,
you can start automating below app
http://enterprise.demo.orangehrmlive.com/symfony/web/index.php/auth/login
Once you face any issue then google it or refer my videos and post for the same.
Aayushi says
Hello Sir,
I wrote the script on login page when it opens the home page, i wrote another test script to open the link but its not opening its get stop after successfully login, please help me is their more code i need to add to perform the further operation
Mukesh Otwani says
Hi Aayushi,
What error you are getting ?
Santosh says
Well You truly live by this quote “Gaining knowledge, is the first step to wisdom, SHARING it, is the first step to humanity ”
Very good information about selenium . Thanks Mukesh
Mukesh Otwani says
Thank you so much Santosh
kd6883 says
Good Information on Selenium
Mukesh Otwani says
Thanks KD