Question
When do we use findElement() and findElements()

Answers

findElement(): findElement() is used to find the first element in the current web page matching to the specified locator value. Take a note that only first matching element would be fetched.

Syntax:

WebElement element =

driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));



findElements():
findElements() is used to find all the elements in the current web page matching to the specified locator value. Take a note that all the matching elements would be fetched and stored in the list of WebElements.

Syntax:
List elementList =

driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q The oath of office is administered to the Governor by the
  • Q In the BIOS GUI what does IDE channels signify?
  • Q Where could you spend a Markka
  • Q What are the advantages of using assemble language programming?
  • Q what is the maximum size of stack and heap?
  • Q From which peopletools onwards the XML publisher is applicable?
  • Q You have a Class C network, and you need ten subnets. You wish to have as many addresses available for hosts as possible. Which one of the following subnet masks should you use? A. 255.255.255.192 B. 255.255.255.224 C. 255.255.255.240 D. 255.255.255.248 E. None of the above
  • Q If a train covers 600m in 0.5 seconds, how long it will cover in 10 seconds?
  • Q Bondi Grape Blueberry Lime Tangerine Strawberry colours what
  • Q What is best data structure to store the processes info in a real timeb operating system?
  • Q Are view updateable?