Web driver commands in Selenium
  • Share this blog:


Web driver commands in Selenium

1)Browser commands:-

  1. a) get c:- It is to open the URL of the application
  2. b) quit():- It is to close the browser


  1. c) close();- It is to close the popup windows or child windows


2) Interactive commands:-

  1. a) send keys():-It is to enter some values in the text box
  2. b) click():- By using this command we can click on a button, radio button, check box, image &l ink
  3. c) New select:- It is to select the value from a dropdown or list box or combo box

2How to handle java scripts alerts &pop-up and child window?

2write 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.

2How to handle java scripts alert?

2To 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();


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.

2To 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”);

2we are unable to take the main window name by using selenium.ioe

Check out the top Selenium Interview Questions now!

Get window handling:-

2It 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?

2It 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

2Based on the above statistics we can provide the plan [test plan]

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses


About Author
Author Bio

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.

Stay Updated

Get stories of change makers and innovators from the startup ecosystem in your inbox