[Webtest] R_1092: Errors while evaluating simple XPath expression in StoreXPath

Denis N. Antonioli webtest@lists.canoo.com
Sat, 7 Jan 2006 22:40:45 +0100


Welcome to webtest

I guess it is a FAQ:

webtest inserts a tbody in your document, like:
//form[@id='Netui_Form_0']/table[1]/tbody/tr[1]/td[2]/span


Happy testing
	dna

On 7 janv. 06, at 22:18, vikram shevde wrote:

> Hi all,
>
> I searched the list before posting my issue,so have tried my best  
> not to duplicate known posts.I would sincerely appreciate it if  
> anyone could help me out. Here is my issue:
> I am using WebTest R_1092. We use BEA's WebLogic workshop to  
> develop our web app.
>
> The functionality i want to test deals with creating a document  
> which gets assigned a unique document number by the database. I  
> want to use the StoreXPath step to grab this auto-generated ID. I  
> used XPathExplorer to generate the XPath query for the value i want  
> to get ,and XPath Explorer evaluates this query properly, but when  
> i use this XPath expression, WebTest gives the following error:
>
> <failure message="com.canoo.webtest.engine.StepFailedException: No  
> match for xpath expression &lt;//form[@id='Netui_Form_0']/table[1]/ 
> tr[1]/td[2]/span>, Step: StoreXPath at C:\gol\src\golApp\golWebTest 
> \resources\test\RFACreationTest.xml:67:  with  
> (property=&quot;extractedRfpId&quot;, description=&quot;Extract  
> Value of the RFA Id just created&quot;, xpath=&quot;//form 
> [@id='Netui_Form_0']/table[1]/tr[1]/td[2]/span&quot;,  
> stepType=&quot;storeXPath&quot;)"/>
> Here is the XPath step i am trying to use:
>
>     <storeXPath
>             description="Extract Value of the RFA Id just created"
>             xpath="//form[@id='Netui_Form_0']/table[1]/tr[1]/td[2]/ 
> span"
>             property="extractedRfpId"/>
>
> I am also attaching the HTML stored by Canoo if anyone wants to  
> test this out. I sincerely appreciate all help on this, as using  
> XPath is critical to our tests.
>
> Thanks in advance!
>
> Vik.
> <response_1136594852421_invoke.html>

-- 
If you understand what you're doing, you're not learning anything.
   -- Abraham Lincoln