RE: Check that a select field has not more than one option

Michael Zwick <Michael.Zwick-/TvygBFiTMdWk0Htik3J/[email protected]>
Newsgroups gmane.comp.web.canoo.webtest
Message-ID <[email protected]>
Hi Stefan,

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

Michael



-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stefan Seger
Sent: Wednesday, June 29, 2011 3:02 PM
To: [email protected]
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 tried
the following:

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

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

Are there any ideas how I can solve this?

BR,
Stefan
-- 
View this message in context: http://old.nabble.com/Check-that-a-select-field-has-not-more-than-one-option-tp31954561p31954561.html
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.