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
How is assert command different from verify command?
How to pass parameters using testng.xml?
What is the difference b/w close () and quit ()?
What is difference between assert and verify commands?
What do we mean selenium selenium 1 and 2?
Write a code to wait for a particular element to be visible on a page. Write a code to wait for an alert to appear.
List the parameters that one needs to pass in selenium.
What are the main advantages of selenium?
Differentiate between ‘/’ and ‘//’.
What are the different types of annotations which are used in selenium?
How to achieve database testing in selenium?
What is the alternative to driver.get() method to open an url using selenium webdriver?
What is the selenium webdriver?
How to perform right click using selenium webdriver?
What is the super interface of webdriver?