What is the most common way to find an element on a page?

Options
- ID
- XPath
- CSS selector
- Name


CORRECT ANSWER : ID

Discussion Board
Selenium

Answer: ID
Solution: ID: ID is a unique number or value for every element or object of system that is used for searching elements.
It is the fastest and easiest way for searching element because it search element by using getelementid function.
Xpath: Xpath is used to locate element on web page. It is also the fastest way for searching elements or objects, but it uses very complex selector in commands.
CSS selector: CCS selector is used in selenium for finding the object or element in the page or system, but it is not flexible as Xpath technique.
Name: Name is same as ID but it use name in behalf of unique id. It uses different types of filter for refining the location.
Therefore ID is the most common way for searching element.


Rohit Srivastava 07-28-2014 05:38 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement