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 to pass parameters using testng.xml?
How do you get the current page url?
While using click command can you use screen coordinate?
What are the types of webdriver apis available in selenium?
List some scenarios which we cannot automate using selenium webdriver?
In selenium ide what are the element locators that can be used to locate elements on web page?
How recorded command can be edited in ide?
What are some limitations of selenium?
How to upload a file in selenium webdriver?
What are different forms of selenium?
What if you have written your own element locator and how would you test it?
What is the automation test?
How to fetch the current page url in selenium?
How many exemptions do you know in selenium webdriver?
How do perform drag and drop using selenium webdriver?