5 messages in com.canoo.lists.webtestRe: [Webtest] How to Get value from a...
FromSent OnAttachments
Siju John02 Feb 2004 02:27 
Janno Kusman02 Feb 2004 03:53 
Marc Guillemot02 Feb 2004 04:27 
Aatish Arora04 Feb 2004 06:04 
Marc Guillemot05 Feb 2004 00:38 
Subject:Re: [Webtest] How to Get value from a field
From:Marc Guillemot (mgui@yahoo.fr)
Date:02/02/2004 04:27:53 AM
List:com.canoo.lists.webtest

Siju John wrote:

We have "setinputfield" to set the value to a given field. I want the opposite. I want to get the value of the given field.

e.g. unique id = 1 I want to get the value "1" provided the unique id name. Pls anybody can help.

With xpath you can read all what you want, eg for

<input type="text" name="foo" value="1">

you can use

<storexpath xpath="//input[@name='foo']/@value" property="myProp"/>

If you have more than one field named "foo" in the page, the best way is to add an id:

<input type="text" name="foo" id="theFieldIWantToRead" value="1">

then you can use

<storexpath xpath="//input[@id='theFieldIWantToRead']/@value"
property="myProp"/>

Hope this helps.

Marc.