Web driver commands in Selenium
- a) get c:- It is to open the URL of the application
- b) quit():- It is to close the browser
- c) close();- It is to close the popup windows or child windows
2) Interactive commands:-
- a) send keys():-It is to enter some values in the text box
- b) click():- By using this command we can click on a button, radio button, check box, image &l ink
- c) New select:- It is to select the value from a dropdown or list box or combo box
How to handle java scripts alerts &pop-up and child window?
How to handle java scripts alert?
To handle the alerts we need to navigate from the browser to alert then we can perform either ok or cancel
At TekSlate, we offer resources that help you in learning various IT courses.
We avail both written material and demo video tutorials.
To gain in-depth knowledge and be on par with practical experience,then explore Selenium Training.
Accept():- It is to click OK on the dialog alert & confirmation alert.
Dismin():- It is to click cancel on the confirmation alert
Gettext():- we can take text or label from the application where the web driver is having the
String str =driver.switch to().alert().get text();
** write a program to search for one way flights in spicejet.com then hit ok on the at confirmation
Alert message.click on the popup click on the close button to close the popup. select any convert
converter link then enter values in the popup click on the close button to close the popup. select
any value from going to find in the main window.
To handle the popup we need to navigate from the main window to pop-up with the help of below
Driver.switch to().window(“window name”);
we are unable to take the main window name by using selenium.ioe
Check out the top Selenium Interview Questions now!
Get window handling:-
It will return the window name where the web driver is having the focus into a string.
String str=driver.getwindow handle();
** How many we can automate per day?
It always depends on the project and test scenarios. But on average we
Can automate 5 to 6 scenarios per day.
It means we are taking 1 to1.5 hour for one test scripts why?
2) write scripts[test dater,locator]
4) stable the script
Based on the above statistics we can provide the plan [test plan]
For an Indepth knowledge on Selenium, click on below
- Io streams /external files in Selenium
- Selenium Grid
- Conditional statements in Selenium
- Different flavors of Selenium
- Selenium WebDriver Features