Hey there! any question in your mind? Ask It Now!.

Popular Categories

how to construct proper xpath without using 'div'

0 votes
asked in Software Testing by anonymous
don't want to use the auto-generated xpath from chrome or firefox,

want to contruct proper xpath manually for watir web driver

1 Answer

0 votes
answered by anonymous

Let me explain first , Watir is an open source library of Ruby . It's very easy to write and execute test cases with the help of this library . for automating we applications we need an address path which is XPath.

How to create XPath : 

Let's take an example , this is a heading 

<h1 id="header">Header</h1>

Now test case is to click on this heading.


so the xpath will be : 

browser.h1(:xpath, "//h1[@id='header']").click


For more deatils, pls refer this document .

Related Questions

+5 votes
7 answers 14,590 views
+1 vote
1 answer 2,239 views
+2 votes
1 answer 1,241 views
+1 vote
0 answers 95 views
+1 vote
1 answer 2,611 views
+1 vote
1 answer 544 views
+2 votes
1 answer 134 views

Not a Member yet?

Ask to Folks Login

My Account
1070 Folks are online
79 members and 991 guest online
Your feedback is highly appreciated