Hi Thomas,

 

your tip on XPather was a very good one. After installing the addon, I found 
out that the exact path to the tag included another tag called 'tbody' which is 
actually nowhere to be found in the source code (at least, I can't see it ;-)).

 

XPather returns the following path and the webtest is successful:

 

/html/body/table/tbody/tr[1]/td

 

I added some additional tags to the /td in the end to make sure I really have 
the correct one.

 

Thanks for your help.

 

Gert
 


From: [email protected]
To: [email protected]; [email protected]
Subject: RE: [Webtest] Finding correct xpath
Date: Mon, 1 Mar 2010 11:21:13 +0000




Hi,
 
did you check in the results what the "resulting page" for the invoke looks 
like?
I'm not too savvy about the "normalize-space" you are using, but I think you 
might know why you are using it. :)
 
Also, it may be worth checking the live page with e.g. Firefox and the XPather 
addon (or with XPath-Explorer) to see if there is anything that you missed on.
 
HTH,
Thomas
 

Thomas Klein
Senior Associate QA | SapientNitro




From: [email protected] [mailto:[email protected]] On 
Behalf Of Gert Pauwels
Sent: Monday, March 01, 2010 11:47 AM
To: [email protected]
Subject: [Webtest] Finding correct xpath


Hi,
 
I'm struggling to find the correct xpath for a tag in my html file:
 
        <table cellspacing="0" cellpadding="5" border="0" width="100%">
        <tr>
                <td  colspan="1" rowspan="1" valign="top">
                        <ul class="tabs">
                                <li class="on"><a onClick="cursorWait();" 
href="screen/view.do?screenId=8812&sectionId=21389&wizardExecuted=null">Filter</a></li>
                                                </ul>
                                                <div class="tabArea" 
style="width: auto; padding: 6px;">
                                                        <div class="row">
I have tried several xpaths, and none of them come back with the correct 
result:xpath="normalize-space(table[1]/tr[1]/td[1]/u...@class='tabs']/l...@class='on']/a)"
 text="Filter"/>

xpath="normalize-space(table[1]/tr[1]/td[1]/u...@class='tabs']/l...@class='on']/a='Filter')"
 text="Filter"/>

xpath="normalize-space(/body/table[1]/tr[1]/td[1]/u...@class='tabs']/l...@class='on']/a)"
 text="Filter"/>
 
The webtest always fails...
 
Gert



Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.  
                                          
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969

Reply via email to