[Webtest] Check that a select field has not more than one option

Michael Zwick Michael Zwick <Michael.Zwick@genedata.com>
Wed, 29 Jun 2011 15:43:51 +0200

Hi Stefan,

My recommendation would be to find a general XPath expression for the secon=
d option of the select field node which shouldn't exist. (Could be accompli=
shed by first finding an appropriate XPath for the existing first option an=
d from there "increasing the node number"). Then replace <not><setSelectFie=
ld.../></not> by <not><verifyXPath.../><not> to verify that the second opti=
on of the select field isn't there.
<setSelectField.../> for an inexistent option index apparently doesn't give=
 false but rather an exception.


-----Original Message-----
From: webtest-admin@lists.canoo.com [mailto:webtest-admin@lists.canoo.com] =
On Behalf Of Stefan Seger
Sent: Wednesday, June 29, 2011 3:02 PM
To: webtest@lists.canoo.com
Subject: [Webtest] Check that a select field has not more than one option

Hi all,

I have a little problem here with my tests. In one test case, when I choose
a specific option in a select field, a second select field gets filled
dynamically with options.

So, I want to test that the second select field has only one option. I trie=
the following:

<setSelectField name=3D"client_sign" optionIndex=3D"0" />
<setSelectField name=3D"owner_group" optionIndex=3D"0" />
	<setSelectField name=3D"owner_group" optionIndex=3D"1" />

The problem, that Canoo gets an IndexOutOfBoundException by the attempt to
select the second option.

Are there any ideas how I can solve this?

View this message in context: http://old.nabble.com/Check-that-a-select-fie=
Sent from the WebTest mailing list archive at Nabble.com.

WebTest mailing list