Learn Selenium With Quiz – Advance Level 7 – XPath

As a part of a Series of posts on Learn Selenium With Quiz, This set contains questions from XPath concepts in Selenium WebDriver. I will suggest you to go through below link before taking up quiz:

XPath Basics 1

XPath Basic 2

Advanced XPath

Now take up below quiz:-

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:

Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

6 thoughts on “Learn Selenium With Quiz – Advance Level 7 – XPath

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.
%d bloggers like this: