Difference between @findByMethod and @findelement?
Answer Posted / ram
findElement() :
-Find the first element within the current page using the given "locating mechanism".
-Returns a single WebElement.
-Syntax: WebElement findElement(By by).
–will throw "NoSuchElementException" if no matching element found
findElements() :
-Find all elements within the current page using the given "locating mechanism".
-Returns List of WebElements.
-Syntax: java.util.List<WebElement> findElements(By by)
–will return a empty list if no matching elements found and no exception will be thrown
| Is This Answer Correct ? | 6 Yes | 13 No |
Post New Answer View All Answers
What is selenese and what are the types of selenese?
What is heightened privileges browsers?
Can we use selenium rc for tests driving on two different browsers on one operating system without selenium grid?
What is the testng.xml file used for?
When we use findElement () and findElements () findElement ()?
What You Know About Selenium Grid?
How to capture bitmaps in selenium?
How to export selenium ide test suite to selenium rc suites?
Can captcha and bar code reader be automated by using selenium?
Mention what is selenium 3.0?
What are testing types supported by selenium?
What is the use of context menu in selenium ide?
What is the meaning of assertion in selenium and what are the types of assertion?
What kind of keyboard operations can be performed in selenium?
How to connect a database in selenium?