Learn Selenium With Quiz – Advance Level 7 – XPath

Which XPath syntax is correct below:-

Please select 2 correct answers

Correct! Wrong!

"contains()" is a XPath method which can be used to check value of an attribute or text of web element containing a particular character or string. "contains()" takes two arguments. First argument is for attribute name or text. Second argument is value to check for. If you are passing an attribute, you need to use @ symbol before attribute name. If you use text, you need to pass text() method.

Which XPath syntax is correct below:-

Please select 2 correct answers

Correct! Wrong!

"contains()" is a XPath method which can be used to check value of an attribute or text of web element containing a particular character or string. "contains()" takes two arguments. First argument is for attribute name or text. Second argument is value to check for. If you are passing an attribute, you need to use @ symbol before attribute name. If you use text, you need to pass text() method.

Which XPath syntax is correct to identify a web element using multiple attributes?

Correct! Wrong!

Logical operators can be used to locate a web element with its multiple attributes. You can locate a web element by using its multiple attribute using "and" and "or". Remember here that both keywords are case sensitive.

Which XPath syntax is correct to identify a web element using multiple attributes?

Correct! Wrong!

Logical operators can be used to locate a web element with its multiple attributes. You can locate a web element by using its multiple attribute using "and" and "or". Remember here that both keywords are case sensitive.

Which XPath syntax is correct to identify a web element using multiple attributes?

Please select 2 correct answers

Correct! Wrong!

Logical operators can be used to locate a web element with its multiple attributes. You can locate a web element by using its multiple attribute using "and" and "or". Remember here that both keywords are case sensitive.

Which XPath syntax is correct to identify a web element using multiple attributes?

Correct! Wrong!

Logical operators can be used to locate a web element with its multiple attributes. You can locate a web element by using its multiple attribute using "and" and "or". Remember here that both keywords are case sensitive.

Which is valid XPath expression below?

Correct! Wrong!

We can select the union of all nodes selected by XPath expr1 and all nodes selected by XPath expr2. Remember we do not have any thing for intersection of xpath expressions. We need to use pipe symbol ( '|' ) to find union.

Which is valid XPath expression below?

Please select 2 correct answers

Correct! Wrong!

starts-with() is a XPath method which can be used to check value of an attribute or text of web element starts with a particular character or string.

Which XPath expression is correct to get last element from array of elements?

Correct! Wrong!

last() method gives you the last element from array of elements. You must need to group before applying any filter. "//img[last()]" and "//img" will give you same results.

Which XPath syntax is correct to retrieve a particular indexed element from an Array of elements?

Correct! Wrong!

We can use position() method to get a particular indexed element from an array of elements.

Learn Selenium With Quiz – Advance Level 7 – XPath
You scored:-

Share your Results:

Leave a Reply

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.