1)Browser commands:-
driver.quit();
driver.close();
2) Interactive commands:-
How to handle java scripts alerts &pop-up and child window?
write a program to search for one way figure in spicejet.com then click either ok or cancel in javascript .before clicking print the message which is available on alert.
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
Driver.switchto().alert().accept();
Driver.switchto().alert().dismin();
Gettext():- we can take text or label from the application where the web driver is having the
Focus.
String str =driver.switch to().alert().get text();
System.out.println(str);
Popup handling:-
** 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
Command
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();
Driver.switch to().window(str);
** 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?
1) Analysis
2) write scripts[test dater,locator]
3) Execute
4) stable the script
Based on the above statistics we can provide the plan [test plan]
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.