Interview Question: How do you identify objects in Selenium WebDriver?

How do you identify application objects in Selenium WebDriver?

What are the different locators available in Selenium WebDriver?

Interviewer:    Do you know the locating strategies in selenium webdriver?

Candidate:  Yes Sir. I know it. There are different element locators  available in selenium . They are as follows:

driver.findElement(By.className(” “));

driver.findElement(By.cssSelector(” “));

driver.findElement(By.id(” “));

driver.findElement(By.linkText(” “));

driver.findElement(By.name(” “));

driver.findElement(By.partialLinkText(“”));

driver.findElement(By.tagName(“”));

driver.findElement(By.xpath(“”));

Interviewer:   What is driver in this?

Candidate:  WebDriver driver=new FirefoxDriver();

Be First to Comment

Leave a Reply

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