We are going to find an element on the page by using the findElementsByLinkText() method that is on each of the Browser Driver classes.findElements calls will return a list of WebElement objects that we can perform actions on.
Follow these steps to see it work:
Open your Java IDE. Intellij or Eclipse are the most used.
We are going to use the command.
Run the test from the IDE. It will look like the following screenshot:
What just happened?
We have just seen how we can find an element by using the findElementsByLinkText helper method. One thing to note is that the search for the text is case sensitive. If an element is not found in Selenium, WebDriver will return an empty list.
Pop quiz - finding elements using helper methods
What is the best call for finding multiple elements using XPath?
What is the best call to an element using CSS selectors to find an element just on the class name?
Will a findElements type call throw a NoSuchElementException when it can't find the element?
Have a go hero - using findElement Helper methods
Try creating an example where you need to find an element by CSS selector. This is used by findElementByCssSelector and findElementsByCssSelector. Have a try!
Selenium Related Interview Questions
|SILK TEST Interview Questions||QTP Interview Questions|
|JMeter Interview Questions||Automation Testing Interview Questions|
|Software testing Interview Questions||JUnit Interview Questions|
|TestNG Interview Questions||SAP Testing Interview Questions|
|Selenium WebDriver Interview Questions||Selenium IDE Interview Questions|
|QUnit Testing Interview Questions||Performance Testing Interview Questions|
|Hadoop Testing Interview Questions|
Getting Started With Selenium Ide
Overview Of Selenium Webdriver
Working With Webdriver
Getting Started With Selenium Grid
Advanced User Interactions
Working With Html5
Migrating From Remote Control To Webdriver
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.