Web Stories - Articles - Questions - Post - Experiences
menu search
brightness_auto
Add Knowledge - Updates - Promotion
more_vert

Selenium is an automation testing framework for web and mobile apps. Selenium scripts are written in java/php/ruby/c# etc 

e.g. Registration page: There are 3 html input elements, userid, password and email address.

Steps to enter data in input objects:

1.Script will open the page

2. Script will identify the input element

3. Script will then enter data in input element

So the question is how selenium code identifies the input elements? The answer is Xpath or CSS Seector.

In Xpath: html code is treated like a document having ancestor, desendent, parent, grand parent, child, grand child, sibling, following sibling. 

So to identify an element e.g. userid textbox: <input type="text" id="userid" /> we need to write //input[@id="userid"]

  • Find input element which has id=userid: //input[@id="userid"]
  • Parent and grand parents of current element till root node: /ancestor::
  • Child & grand child of current node till current element closes: /descendent::
  • All tags after the current element till html document end: /preceding::
  • Only one immediate parent: /parent::
  • One or more level 1 children till current element closes: /Child::
  • All tags after the current element till document end: /following::
  • Same level following sibling till document end: /following-sibling:: 
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

What are the Challenges you faced in Selenium automation?
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
Read Story...
share
Now a days, everybody is talking about JSON. If you are a Software engineer, you will work with JSON. If you are an automation test engineer, you will...
What is json node and how many types of json node are there ?
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
I am working in a multi national company. We are using TestNG6.9.5 based selenium java framework. Somehow my local setup deleted and now I have to re-...
I am not able to find TestNG6.9.5 in ecllipse, dl.bintray.com is also not working, what to do ?
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
Searched so many websites? Did not find the exact answer of your query? No worries, we will try to answer. ImplicitWait: Where ever you write bel...
What is the technical difference between ImplicitlyWait & ExplicitWait in selenium webdriver?
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
Ads by Zaankari™ Portal
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
Read Story...
share
There are several cases which you can easily solve by using javascriptExecutor. The arguments[0] means the webElement passed in the executeS...
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
VDT - Virtual Display Terminal DMP - Dot Matrix Printer UNIVAC - Universal Automatic Computer EDSAC - Electronic delay storage Automatic Computer...
thumb_up_off_alt 4 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
Ads by Zaankari™ Portal
If you are working with TestNG and Rest Assured framework in Java, then it is very simple to pass some variable/value from one test to another. If yo...
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
Read Story...
share

Most popular questions within the last 4 days

Welcome to Zaankari portal, where you can ask and read questions/answers and stories. Add Questions/Stories/Posts - Earn Points !
...