10 messages in com.canoo.lists.webtestRE: [Webtest] storeXPath Problem
FromSent OnAttachments
Sven Haiges05 Feb 2007 08:01 
Colin O'Brien05 Feb 2007 08:48 
Colin O'Brien06 Feb 2007 01:43 
Sven Haiges06 Feb 2007 02:04 
Marc Guillemot06 Feb 2007 02:08 
Sven Haiges06 Feb 2007 02:18 
Colin O'Brien06 Feb 2007 02:21 
Sven Haiges06 Feb 2007 02:27 
Marc Guillemot06 Feb 2007 02:43 
Sven Haiges06 Feb 2007 02:58 
Subject:RE: [Webtest] storeXPath Problem
From:Colin O'Brien (coli@capetechnologies.com)
Date:02/06/2007 02:21:22 AM
List:com.canoo.lists.webtest

Hi Sven,

To answer your earlier question about the xpath engine in webtest. The jaxen webtest engine is in use and you can find out more information about that and what xpath functions it supports from the following page: http://jaxen.codehaus.org/index.html

The API Docs will give you the most insight...

Regards, Colin.

-----Original Message----- From: webt@lists.canoo.com [mailto:webt@lists.canoo.com] On Behalf Of Sven Haiges Sent: 06 February 2007 10:19 To: webt@lists.canoo.com; Marc Guillemot Subject: Re: [Webtest] storeXPath Problem

HI Marc,

all right, will switch to the latest trunk version. I though using a stable version would be... stable :-) No problem. I was also adding an id field to the html, so should be able to identify the td cell more easily now.

Sorry for the strange description, I am trying to extract an ad id ( id = hibernate id) from an html page. I would like to save that id and later populate a search box to look exactly that id up again. The complete test will create an ad, then change it and delete in the end. That's why I need to store the id as it is the unique identifier.

Will have to make all the changes proposed, then will let you know if it works. Thanx for your patience!

Cheers\ Sven

On 2/6/07, Marc Guillemot <mgui@yahoo.fr> wrote: Hi Sven,

which version of WebTest do you use?

You should use the latest build, release 2.1 for instance is not able to evaluate dynamic properties outside WebTest steps (like echo) and normal Ant properties are evaluated too early.

Otherwise I agree with Colin, that if you really need such an xpath expression, then your code won't be really maintainable. Furthermore I don't understand what you want to achieve from the description "Extract href the id of this advertisement".

Marc.

Colin O'Brien wrote:

Hi Sven,

I think the problem is that because your xpath failed the property 'adId' did not get set so that's probably why your </echo> message didn't operate as expected. Though I'm not 100% on that... Maybe someone else on the list knows more...?

Adding an 'id' attribute to the </td> tag will help in solving your current xpath issues with the cell you're trying to reference.

Regards,

Colin.

-----Original Message----- *From:* Sven Haiges [mailto: sven@googlemail.com] *Sent:* 06 February 2007 09:20 *To:* Colin O'Brien *Subject:* Re: [Webtest] storeXPath Problem

HI Colin,

I am about to add an "id" element to the td tag I am trying to get, so I hope the referencing problem will be gone, soon.

Besides this, I was putting a line like this in my code directly after

the xpath

<echo message="#{adId}"/>

It prints "#{adId}. So I have the strange feeling that I somehow reference the saved expression in a wrong way. But that's how the example shows it:

Just tried to change propertyType to "ant", but using ${adId} also did not succeed.

Any ideas?

Cheers\ Sven

On 2/5/07, *Colin O'Brien *< coli@capetechnologies.com <mailto:coli@capetechnologies.com>> wrote:

Hi Sven,

Try putting /tbody/ between the /table/ and /tr/ tags...

Is that the shortest xpath you can use to reference the cell your looking for...? If you can find a shorter xpath then it'll be easier to use... Can you send a snippet of the HTML you're working on and maybe someone on the list will be able to suggest a better xpath to use...

Cheers,

Colin.

-----Original Message----- *From:* webt@lists.canoo.com <mailto: <mailto:webt@lists.canoo.com> webt@lists.canoo.com> [mailto: webt@lists.canoo.com <mailto:webt@lists.canoo.com >] *On Behalf Of *Sven Haiges *Sent:* 05 February 2007 16:01 *To:* Webtest Mailing List *Subject:* [Webtest] storeXPath Problem

HI all,

I am running into a storeXPatch problem:

<storeXPath description="Extract href the id of this advertisement" xpath="string(//table[3]/tr[2]/td[1]/table[1]/tr[1]/td[2])" property="adId" />

I verified the xpath expression with the xpath explorer. But later in the test, I cannot reference #{adId}

Any ideas? from the archives, it seems there are known issues for this. Is there a workaround? Using 2.1 on Win

Cheers, Sven

-- Sven Haiges sven@googlemail.com <mailto: <mailto:sven@googlemail.com> sven@googlemail.com>

Skype: hansamann Personal Homepage, Wiki & Blog: http://www.svenhaiges.de

Subscribe to the Grails Podcast: http://hansamann.podspot.de/rss

-- Sven Haiges sven@googlemail.com <mailto:sven@googlemail.com> <mailto:sven@googlemail.com>

Skype: hansamann Personal Homepage, Wiki & Blog: http://www.svenhaiges.de

Subscribe to the Grails Podcast: http://hansamann.podspot.de/rss

_______________________________________________ WebTest mailing list WebT@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest

-- Sven Haiges sven@googlemail.com

Skype: hansamann Personal Homepage, Wiki & Blog: http://www.svenhaiges.de

Subscribe to the Grails Podcast: http://hansamann.podspot.de/rss