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 the difference between "assert" and "verify" commands?
What is assertion in selenium?
Do you know any alternative test automation tools for selenium?
Using selenium how can you handle network latency?
How do perform drag and drop using webdriver?
What is the purpose of selenium ide?
What are the different ways in which selenium ide can be opened?
What is exception test in selenium?
What is soft assertion in selenium?
What will be the limits of selenium?
Explain what is the main difference between web-driver and rc?
How recorded command can be edited in ide?
Which technique should you consider using throughout the script “if there is neither frame id nor frame name”?
Tell us can you write the code to double click an element in selenium?
What methods of robot class do you know?