What all commands can be used in Selenium Webdriver to interact with Web elements?

0 votes
What all commands can be used in Selenium Webdriver to interact with Web elements?
Jul 14 in Selenium by Shaibya
18 views

1 answer to this question.

0 votes

Hi Shaibya, some of the commands used to interact with Web elements are:

1. clear( ) : Clears the text entry made to an element.

driver.findElement(By.id("UserName")).clear();

2. sendKeys(String keysToSend ) : This simulate typing into an element, which may set its value. 

driver.findElement(By.id("UserName")).sendKeys("ABC");

3. click( ) : Simulates the clicking of any element.

driver.findElement(By.linkText("Application")).click();

4. isDisplayed( ) : Determines if an element is currently being displayed or not.

boolean staus = driver.findElement(By.id("UserName")).isDisplayed();

5. isEnabled( ) : Determines if the element currently is Enabled or not.

boolean staus = driver.findElement(By.id("Conditions")).isEnabled();

6. isSelected( ) : Determine whether or not this element is selected or not.

boolean staus = driver.findElement(By.id("Gender")).isSelected(); 
answered Jul 15 by Anvi
• 13,400 points

Related Questions In Selenium

+2 votes
2 answers

What are the different Locators that can be used to access Web Elements?

@Nitesh, I would like to tell you ...READ MORE

answered Dec 12, 2018 in Selenium by Priyaj
• 56,900 points
67 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
750 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
995 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
709 views
0 votes
1 answer
0 votes
1 answer