Tuesday 9 June 2020

Tricky Xpath Interview Questions for UI Automation with Selenium Webdriver for QA/SDET? Automation Testing SET-04



 
Refer this for all below questions:
<p class="error-message ng-binding" ng-show="showMessage()" style="" xpath="1">Invalid username or password!</p>

31. How to identify object using xpath for above?

//p[@class='error-message ng-binding']


32. Use contains text to identify above object?

//p[contains(text(),'Invalid')]

33. Use and operator to identify the object with class and ng-show?

//p[@class='error-message ng-binding' and @ng-show='showMessage()']

34. Use or operator to identify the object with class or ng-show?

//p[@class='error-message ng-binding' or @ng-show='showMessage()']

35. How to use starts-with to identify the above object with the first property?

//p[starts-with(@class,'error-message ng-binding')]

36. How to identify an object which is the second child of type link?(parent xpath is "//body//footer//p[1]")

//body//footer//p[1]//child::a[2]

37. How to get all the child for object with xpath as //body//footer//p[1]?

//body//footer//p[1]//child::*

38. How to get all the parent for object with xpath as //body//footer//p[1]?

//body//footer//p[1]//parent::*
 
39.What are the different types of operators in XPath?

 Following are the different types of XPath operators:

  • Comparison Operators
  • Boolean Operators
  • Number Functions/Operators
  • String Functions
  • Node Functions/Operators

40. CSS vs Xpath?

- XPath we can traverse both forward and backward whereas CSS selector only moves forward.

- Xpath engines are different in each browser, hence make them inconsistent 


Check below link for API testing Interview questions:
API Testing Interview Qus

*************************************************

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

4 comments:

All Time Popular Posts

Most Featured Post

API Status Codes with examples for QA-Testers

  🔺 LinkedIn: https://www.linkedin.com/in/sidharth-shukla-77b53145/ 🔺 Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 🏮In API testing, it...