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,605 views
+1 vote
1 answer 2,250 views
+2 votes
1 answer 1,263 views
+1 vote
0 answers 99 views
+1 vote
1 answer 2,819 views
+1 vote
1 answer 547 views
+2 votes
1 answer 135 views

Not a Member yet?

Ask to Folks Login

My Account
606 Folks are online
89 members and 517 guest online
Your feedback is highly appreciated