If you want to contact me directly then free to send an email to mukeshotwani@learn-automation.com
I will try to connect with you within 24 hours.
Selenium WebDriver tutorial Step by Step
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Adil Raza says
Hi Mukesh I have been following you since last year. Would you mind posting a video on performing actions on elements present in SHADOW DOM. For example click on “Cancel” button of Latest Chrome browser’s PRINT PREVIEW window.
Regards,
Adil
Mukesh Otwani says
Hi Adil,
Thanks for writing to me. I’ll plan for it…:)
Abhijeet Sahoo says
Hi Mukesh Sir,
Sir I have gone through all ur video of selenium .
Sir i have One doubt How to take screenshot on failure using TestNg Listener that u have told on the video .
Sir can you tell bya video .So that it will very helpful for me.
Mukesh Otwani says
Hi Abhijeet,
I’ll post it soon..:)
Shilpa V Kumar says
Hi Mukesh
I have gone through with Serenity BDD framework session from you.
They are really very very helpful.. Thanks for such a wonderful sessions.
Had some clarification with respect ti framework set up like in your video you have covered in depth for UI framework set up but there is no coverage done for API (Rest API) framework set up.
It would be really great if you can provide some inputs on integrating API with UI framework
Mukesh Otwani says
Hi Shilpa,
I’ll post it soon 🙂
sravan says
i have 4 windows and i want to handle 3rd window, Can you please help me to handle 3rd window in a application with a code
Mukesh Otwani says
Hi Sravan,
In order to deal situation in which there are more than 2 window handles, you need to save previous window handles in string type variables so that you can use it later to switch windows.
Kuladip says
Hi Mukesh,
How to enter text in multiple text boxes in pop up window.
Like when I open your url then a pop up will come and ask to enter NAME and EMAIL ID.
How to enter text this type pop up. Please let me know.
Thanks,
Kuladip
Mukesh Otwani says
Hi Kuladip,
Check whether this pop up is on same window. Also check whether any frame in same page.
Nikhil Gupta says
Hi Mukesh, could you publish a video for How to debug Protractor test cases in Jasmine framework using WebStorm/IntelliJ as IDE with setup.
Mukesh Otwani says
Hi Nikhil,
I just started for Protractor and very soon I’ll post video related to your requested topic…:)
Mounika devaraju says
Hi Mukesh,
In order to add cucumber plugin link “http://cucumber.github.io/cucumber-eclipse/update-site/” in eclipse,its asking add repository and finish button is disabled.What I have to give there in the loacation
Mukesh Otwani says
Hi Mounika,
Try to install it from Eclipse Market Place. Help-> Eclipse Market Place -> Search for Cucumber
sakshi says
Hi Mukesh,
is there any way to know about selenium IDE and how it works ??
Mukesh Otwani says
Hi Sakshi,
Selenium IDE is very primitive. Now a days current industry people use WebDriver.
nor says
hi otwani thank you for your cours i,have question about matrice in cucumber selenium i think for orgnizing data
Mukesh Otwani says
Hi Nor,
Are you talking about data table?
Parth Jadeja says
Thanks for all the help.All of your videos have been quite easy to understand for me. Learning automation with “learn-automation”. Keep up the good work.
Mukesh Otwani says
Hi Parth,
Hey buddy, thanks for your appreciation…:)
Amruta says
Hello Mukesh Sir,
I am trying to add firbug and firepath in mozilla firefox 59.0.1 version. But both are not present in latest version. What I do?
Thanks in advance.
Mukesh Otwani says
Hi Amruta,
From Firefox 54 onwards, it doesn’t support Firebug followed by Firepath. If still, you want to use these two addons then kindly downgrade FF to version lower to 54.
janardhan randhi says
Hey amrutha you can use xpath add on for taking xpaths instead of id.
Imrul says
Hi Mukesh,
Can we do headless testing and browser testing using the same framework? I meant design the framework in way that we do both type of testing. Thanks
Mukesh Otwani says
Hi Imrul,
Yes, same framework works for both requirements.
veeresh says
Hi, Mukesh is there any way to know XPath for all elements automatically/one shot? so that we use directly in scripts?
Thanks in advance
Mukesh Otwani says
Hi Veeresh,
As of now, there is no such tool available.
Priyanka says
Hi i am trying to upload multiple files and using selenium web driver send keys but its thronging exception “unknown error: the element can not hold multiple files”
Mukesh Otwani says
Hi Priyanka,
Kindly go through this link http://learn-automation.com/upload-multiple-files-in-selenium-webdriver/
Anish Kumar says
Hi Mukesh,
Thanks for all the Blogs and Videos on Selenium.It has helped me a lot in learning Selenium.
Could you Please tell how to handle the date pickers where the year and month comes as a drop down ?
I saw your video where you have taken Red Bus website for reference but there the date picker is not in the form of dropdown.I am trying to automate the TRAI website http://www.trai.gov.in/telecom/spectrum.
Thanks in anticipation for your response
Regards,
Anish
Mukesh Otwani says
Hi Anish,
Not each and every date picker controls behave same. So here what you need to do is first click on those date input box. Wait for 2-3 seconds then you select your required month and year using Select class. finally, go for a date which you want.
Suraj says
Hi Mukesh,
I am new in automation and i am using selenium-java-3.5.3, FF version 48 and geckodriver-v0.19.1-win32.
My code is
public class FacebookRegistration {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty(“webdriver.gecko.driver”,”E:\\QA\\Software\\driver\\geckodriver.exe”);
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get(“https://www.facebook.com”);
}
}
but whenever i ran this script so in console i got below warning every time and browser is just opening nothing else.
LdrLoadDll: Blocking load of ‘activedetect32.dll’ — see http://www.mozilla.com/en-US/blocklist/
1511704811764 Marionette INFO Listening on port 2828
LdrLoadDll: Blocking load of ‘activedetect32.dll’ — see http://www.mozilla.com/en-US/blocklist/
LdrLoadDll: Blocking load of ‘activedetect32.dll’ — see http://www.mozilla.com/en-US/blocklist/
So please help me what should i do?
Mukesh Otwani says
Hi Suraj,
Please try same with Selenium 2.53.1 with Firefox 46.0
Rahul says
Your browser is not compatable with the selenium version so please delete the browser and download the latest version
Kamal Preet says
Hi, Could you please tell me how can i write xpath for first element of a table. FOr eg, on flipkart, I search Laptops and get a set of results.. but since everyday the first record may change, how do i click on the first record everytime in land on the same page.
Mukesh Otwani says
Hi Kamal,
Your xpath should be generic instead of taking any specific attribute which contains product property. Kindly go through this link http://learn-automation.com/how-to-write-dynamic-xpath-in-selenium/
bhargavi says
Hi Mukesh sir,
I am getting this error when i choose to go with actions.Help me to solve this error as soon as possible.
Exception in thread “main” org.openqa.selenium.WebDriverException: performActions
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘ROHITH-PC’, ip: ‘192.168.1.2’, os.name: ‘Windows 7’, os.arch: ‘x86’, os.version: ‘6.1’, java.version: ‘1.8.0’
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160726073904, version=48.0, platform=XP, proxy=Proxy(), command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=48.0, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=XP, device=desktop}]
Session ID: e14be40b-5755-48a4-a355-cdc2867b5a27
Mukesh Otwani says
Hi Bhargavi,
If you are using Selenium 3.x.x then I would suggest you to use selenium 2.53.1 with FF 46.0. Chrome and chromedriver should be latest.
Vandana says
ExtentReport jar files are not available now It is chargable.
Please help
Mukesh Otwani says
Hi Vandana,
It is not fully paid, Anshoo has put few glittering features as paid. You can still get access for Community Edition over here http://extentreports.com/community/
Thirupati Marisetti says
Please give a way to resolve this issue sir.
I am working on web app for test the application through selenium web driver, i want to handle the angularJS calendar ng-click function,the calendar click function is working fine whenever i am checking through Inspect element with Firebug of FirePath but it’s not working while i am run the program instead of that the system is showing skipping the calendar function scenario while cursor on the calendar click button.
Mukesh Otwani says
Hi Thirupati,
You can give try to Actions class using moveToElement followed by click action but I am not sure about this. Pure Selenium APIs works on whatever can be inspected from DOM structure.
Sreekumar says
Hi Mukesh
I am trying to file upload in mac using your code. Loosing focus on window dialog.
Can you tell me the to focus for a window
or any way to upload file in MAC
Mukesh Otwani says
Hi Sreekumar,
I hope this will help you http://learn-automation.com/upload-file-in-selenium-in-mac/
pratap says
Hi mukesh, can u explain , process or flow of project for automation testing in the companies.
Mukesh Otwani says
Hi Pratap,
It differs organization to organization.
mubashir says
how to specify excel file format with apache poi in ms excel 2010.while excel 2003 w use .xlsx file format ,but am unable to execute in ms excel 2010
Mukesh Otwani says
Hi Mubashir,
Please check this link http://learn-automation.com/read-and-write-excel-files-in-selenium/
suraj says
Hi Mukesh,
Can we use Extent Reports with Groovy Scripting?
Mukesh Otwani says
Hi Suraj,
I never tried groovy with extent report. If you are looking for same then raise your concern on this link
Madhuri says
Hi Mukesh,
How do i click on a button in excel file using poi api?
Thanks,
Madhuri
Mukesh Otwani says
Hi Madhuri,
Apache POIs’ are used for reading/writing to MS Office Applications.
And if I am correct then you are looking for click on button being embedded inside Excel file which will trigger some macro/vba code, this thing is not covered under Apache POI API.
It it related to Visual Basic scripting.
vishal Rattan says
Hi Mukesh,
When i am creating firefoxdriver object it will give me error but when i am pointing to error i can not get link for import fireboxdriver what i am missing in this case.
Mukesh Otwani says
Hi Vishal,
There could be two reasons for this, either you didn’t add Selenium jar files to project build path or you have added individual selenium jar files along with Selenium standalone jar file also.
If you are dealing with second case then i would suggest you to keep Selenium standalone jar file with project and remove all other selenium jar files.
Prem kumar says
Hi Mukesh,
I used your videos to configure teh tools for mobile automation testing.. Really videos are awesome. I copied your code and executed it. I got below error.
A new session could not be created. (Original error: The following desired capabilities are required, but were not provided: platformName, deviceName)
I am unable to run the code. Please help me ASAP. I need to give demo to client in 2 days.
Thanks in advance.
Mukesh Otwani says
Hi Prem,
Kindly check your code from this link http://learn-automation.com/execute-appium-selenium-test-android-chrome-browser/
madhuri says
Hi,
How do I open excel files from chrome?
driver. get(“file:///C://Users//username//Downloads//e20a4f0d-55e9-4cc7-abdb-845c44c3774f.xlsx”);
If I do this it is downloading the file again but it does not open the file.
Please help.
Thanks
Mukesh Otwani says
Hi Madhuri,
As of now, Web Browsers don’t have capability to open most of MS Office files that’s why the file is getting download. If you want to do any read operation from file then this post will help you a lot http://learn-automation.com/read-and-write-excel-files-in-selenium/
Savitha says
Hi Mukesh,
I am new to selenium and facing some issues with IE browser as my organization denied to check protected mode for Intranet and Trusted sites.
Hence unable to identify element in IE browser . I have installed both 32 bit and 64 bit but neither is working.
As per your comment I have also changed registry settings:
For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE.
Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.
Error message is displayed as:
org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 33 milliseconds
Repeatedly i am getting same error message even after changing registry but i cannot change my internet security setting. please provide me some solution for this problem
Looking forward for your reply!
Mukesh Otwani says
Hi Savitha,
Ask your system administrator to allow Protected Mode Settings to be editable.
madh says
Can you please post on how to automate export to excel functionality using selenium and java?
Mukesh Otwani says
Hi Madh,
Please refer this link http://learn-automation.com/read-and-write-excel-files-in-selenium/
Tulika says
Sir
I want to try to verify color of the image using Selenium.,trying with & without html/tagging properties. Is it possible to do so?
Mukesh Otwani says
Hi Tulika,
WebDriver always works based on the DOM structure and its tag. In order to verify color of any element, you need to provide element property/properties which comes under a tag.
Bhavesh says
Hi,
I am using “extentreports-java-1.4” and its working fine,
but now I have added the latest jar files of “extentreports-java-2.41.2” then it shows some errors in the code See this – https://ibb.co/enjXGQ
Will I need to update any code after updating latest version of extent report?
Please help me.
Thanks
Mukesh Otwani says
Hi Bhavesh,
I think so but I am not pretty much sure as I didn’t work on version 1.x.x. But there are lot of changes between version 2.x.x and 3.x.x.
Kindly check docs of version 2.x.x (Extent Report 2.x.x)
Rashmi says
Also Please tell is there any way to share the screen shot for the error .
Mukesh Otwani says
Hi Rashmi,
You can put scrnshot in html report and share the url of same. Another way, you can send it as email using postman plugin, check this link http://doc.fortysix.ch/maven/maven-postman-plugin/
Bhavesh says
Will you please make video tutorial on this to send mail if any test case get fail?
Mukesh Otwani says
Hi Bhavesh,
I’ll post this topic in my blog soon but for your ready reference, please refer this link
neha kumari says
Hi mukesh
I am getting this Error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:testCompile (default-testCompile) on project LearnMevenAutomation: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
i checked with execution environment;changed path and now pointing to jdk(1.8),but doesn’t help,getting same error.
same version is in pom.xml and system path as well
Mukesh Otwani says
Hi Neha,
Did you try Project–> Right click–> Maven–> Update Project….?
neha gupta says
Hi Mukesh,
Am facing issue when i import existing maven project . Getting error in POM.xml. Am using Luna4.4.0 version. Below is the error messgae .
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out
and maven dependency problem , maven configuration problem, maven problem.
Please help me what needs to be done.
i haven’t used any proxy.
Mukesh Otwani says
Hi Neha,
Please refer this link https://maven.apache.org/settings.html
Lydia says
Hi Mukesh otwani , i am following your tutorial for learning automation and i was using your demo site:http://demosite.center/wordpress/wp-login.php. Which has been very helpful but now i am getting the following page when i try to automate the log in. Please help
Forbidden
You don’t have permission to access /wordpress/wp-login.php on this server.
Apache/2.4.10 (Debian) Server at demosite.center Port 80
please help
Thanks
Mukesh Otwani says
Hi Lydia,
Apologies for late reply.
Looks like, it was temporary issue. Could you please check it again.
Sudheer says
Hi Mukesh,
How to send emails to out look after executing our selenium scripts. I need to send log report and screenshot attachments. Can you help me on this.
Thanks,
Sudheer.
Mukesh Otwani says
Hi Sudheer,
There is a maven plugin called as Postman which might help you. Check this link http://doc.fortysix.ch/maven/maven-postman-plugin/
Chitra says
Hi Mukesh,
Thanks for providing wonderful platform to learn automation testing. Just curious if there is any video or post regarding how to locate elements for mobile native apps using appium.
Mukesh Otwani says
Hi chitra,
I’ll do it soon…:)
keerthi says
hi all, can anyone tell me which windows, which version of firefox, gecko driver version, standalone jar are compatibale and can run the script. Im using windows-10, firefox-52, Selenium jar-3.0, gecko driver-0.15….here im unable to open the url and throwing error as “Unable to create a new remote session. desired capabilities = capabilities [{marionette= true…..”
Mukesh Otwani says
Hi Keerthi,
As of now, even though there correct combination of Selenium version along with geckodriver open web url but there is no proper assurance of working of all classes available in Selenium APIs’. So I would suggest you to go for Selenium 2.53.1 along with FF 46.0. OS could be any Windows 7/8/8.1/10
Hemalatha says
Is it possible to automate Mainframe application using Selenium? As I Know Mainframe is Windows application which cant be automated through Selenium. But I am eager to know if we have any other way to automate it
Mukesh Otwani says
Hi Hemalatha,
No, it is not possible via Selenium.
Hemalatha says
How to integrate HP ALM with Selenium scripts and to update Pass/Fail status for each test case in ALM from Selenium Scripts
Mukesh Otwani says
Hi Hemalatha,
As you know HP ALM is an enterprise product and not an open source. Thats’ the reason I haven’t put any posts related these kind of tools.
shafi says
Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2):
repo.maven.apache.org
its showing like this when i create the maven project, and im using eclipse mars 2. Now what to do?
Mukesh Otwani says
Hi Shafi,
It looks like mavan download of dependencies failed. Did you set any proxy inside settings.xml file. If not, please check this link https://maven.apache.org/settings.html
Priyanka says
Hi Mukesh,
I am using POM model without page factory.
I am new to selenium.
I want to take date like “2017-03-24” from excel sheet and pass it t o datepicker.
I have make date,month,year separate and through xpath selected desired date but with hardcoded number.
I want to take it dynamically from excel. hot to parameterize this and separate month year date and pass from excel to datepicker?
Mukesh Otwani says
Hi Priyanka,
Use split() method based ‘-‘hyphen as delimiter for date which you are reading from excel. Then on webpage, click to enable datepicker, then check year which is available on control and compare it with year from excel. Do same for month and day also. Also refer these two links also Link1 & Link2
Pramod Chegu says
Hi Mukesh,
I am unable to open a new tab in chrome using webdriver code. I am able to open in Firefox using Keys methods. Please share some code. For now i got this using Robot class. Please suggest other solutions if any.
Mukesh Otwani says
Hi Pramod,
Use this ((JavascriptExecutor)driver).executeScript(“window.open(‘https://mail.google.com’,’_blank’);”);. This will open new tab in Chrome but opens new window in FF.
Divya says
Hi..
I am Divya, i want to know that, we can able to find the details of all “”n” no. of users through selenium.
My scenario:
List of users displaying in the table,
we can select the user from table, it will display the details of user in new page.
im facing for some users, details were missing, can we find to which user does the details were missing?
Mukesh Otwani says
Hi Divya,
You can use a looping mechanism and set a counter in that. While iterating through table, check null via getText() and also check emptiness of value attribute. If this condition goes true then increment counter.
Subrata Ghosh says
Hi Mukesh,
i want to store test-output folder in my local drive.
is this possible?
please help me to solve this problem of it is possible…
Mukesh Otwani says
Hi Subrata,
You can use copyFolder command for this. Or else you can do same using batch/shell command.
Vinayak says
Hi Mukesh,
I need a script which reads data from excel using loop conditions because if the requirement asks for 100+ data to read from the excel, it becomes difficult without using loop condition.
I request u to post the script ASAP.
Mukesh Otwani says
Hi Vinayak,
Without looping, I don’t think it is possible. Using look, you can define start and endpoint for row in excel which your script needs to traverse.
tslouby says
Hi, I’m searching how to use the geckowebdriver in a vba macro in firefox 51, it used to be possible with seleniumbasic but doesn’t work anymore. May someone help me?
Thanks
Mukesh Otwani says
Hi Tslouby,
Could you please elaborate your requirement…
Guna says
we need test complete tool tutorial
Mukesh Otwani says
Hi Guna,
Test Complete is proprietary tool. As of now there is no tutorial for this but I am planning to put for same.
Snehal says
Hi Mukesh,
I am trying to achieve cross browser testing functionality in my cucumber selenium java framework. I find very less to none written on this topic. Can you please create some tutorial on this? If you already have can you please put pointers for this?
Also thank you so much for great tutorials on extent reports. Can you add on cucumber extent reports?
Thanks in advance!
Mukesh Otwani says
Hi Snehal,
I am planning for same and post it soon.
Raghavendra says
Hi Mukhesh,
Your videos give lot of clarity and makes it easy to adapt.
Can you please add a video on using extent report through listener level using Page Object Model.
Mukesh Otwani says
Yes Raghu I will try to upload
siva says
I had registered for “Selenium Frameworks and Selenium Questions & Answers” course.
Instead of DataProviderfactory in hybrid framework , we can able to create methods as static methods in config file and we can call that methods without creating objects .
Please suggest inputs on this
Mukesh Otwani says
Hi Siva,
yes you can do that as well our main goal is to reuse the code as much we can. We can do this using multiple ways.
Dawn says
Hello Mukesh,
I love your posts, you are doing so great on automation, I have a question on extent report.
I would like to know in which .jar file that com.relevantcodes.extentreports.Chart is in?
I downloaded extentreports-java-2.41.2 and add all the .jar files in the libraies through JavaBuild Path for the project I am working on, but I still get the error in my coding when I need to import com.relevantcodes.extentreports.Chart.
Can you tell me why?
Thank you very much
Dawn
Mukesh Otwani says
HI Dawn,
Thanks for appreciation. Is there any requirement to use Chart class?
sanjay vaish says
Awesome site sirji !!!!!
Mukesh Otwani says
Thanks Sanjay
Vamsi says
Hello Mukesh,
Thanks for your awesome website, i learnt a lot thorough this site. Can you please help me in 1 aspect. I have keyword driven framework implemented which does not use TestNG. Please guide me on how to generate test reports which does not utilize TestNG functionality.
Thanks.
Mukesh Otwani says
Hi Vamsi,
Any reason for not using TestNG?
Vamsi says
I haven’t thought of this option. I will now try to implement using TestNG. Thanks.
Mukesh Otwani says
ok let me know if it works.
Anson Liao says
Hi Sir,
I watched your selenium video in YOUTUBE, I have some question about ExtentReports.
1.
I would like to know, if add retry listener to testng case in order to the test case fail will rerun the test case (have rerun max count), I would like to know, how a add “Re-run Count” information in ExtentReports as a column?
2.
I would like to add author annoatation in testng class, so I can trace the fail test case’s author to to follow up the test case.
I also would like to add author to ExtentReports as a column, how I can do it?
Mukesh Otwani says
Hi Anson Liao,
Sorry for late reply I was out of town.
Anshoo Arora is the dev and you can praposed these two ideas.
Right now we cant add run time columns.
http://extentreports.relevantcodes.com/java/version2/docs.html just put your comments in Anshoo blog he is very active on this and will provide you soon.
Please check the new version of extent report
http://relevantcodes.com/Tools/ExtentReports2/ExtentJava.html