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 you will login into any site if it is showing any authentication popup for username and password?
How will you handle working with multiple windows in selenium?
What is the reason to use the selenium grid?
What programming languages does Selenium use?
How you can handle frames using selenium 2.0?
How to handle a dropdown in selenium webdriver? How to select a value from dropdown?
What are the different types of frameworks?
How can we select elements by their attribute value using css selector?
How can we maximize browser window in selenium?
What is object repository? How can we create an object repository in selenium?
Other than the default port 444 how you can run selenium server?
How you can insert a start point in selenium ide?
What is the difference between driver.close() and driver.quit command?
What is the difference between the commit and verify commands?
Define selenium 2.x?