• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Web driver commands in Selenium

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

driver.quit();

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

driver.close();

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 java script  .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

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 close button to close the popup.select any convercy

converter link  then enter values in the popup click on close button to close the popup.select

any value from going to find in main window.

2To handle the popup we need to navigate from main window to pop-up with the help of below

Command

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 project and test scenarios.But on an average we

Can automate 5 to 6 scenarios peday.

It means we are taking 1 to1.5 hours 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]

For an Indepth knowledge on Selenium, click on below

Summary
Review Date
Reviewed Item
Web driver commands in Selenium
Author Rating
4

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Web driver commands in Selenium"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.