My Account

how to construct proper xpath without using 'div'

0 votes
92 views
asked in QA Automation 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

+1 vote
1 answer 1,080 views

Not a Member yet?

Answer Queue Login
50 Folks are online
0 members and 50 guest online