[Webtest] Does <select/> have to be in a form...?

Denis N. Antonioli webtest@lists.canoo.com
Mon, 16 Jan 2006 22:17:34 +0100


Hi

starting with build 1130 (today around noon), the setField steps =20
accept an xpath to select a field. So, in theory, you could write:

<setSelectField xpath=3D"//select[@name=3D'XXX']" description=3D"Choose =
the =20
select name XXX" .../>

instead of:
<setSelectField name=3D"XXX" description=3D"Choose the select name =20
XXX" .../>

The xpath looks on the whole page instead of just inside forms.

I'll be happy to hear from you if it's working ;-)

Happy testing
	dna


On 16 janv. 06, at 21:01, Curelea, Alexandru wrote:

> In my experience, any buttons that aren't inside a form cannot be =20
> seen by Webtest.  My solution is to enclose any such buttons in =20
> empty <form></form> tags, which is enough to make Webtest pick it =20
> up, but shouldn't change any functionality.  I wouldn't be =20
> surprised if select fields act the same way...
>
> Alex
> -----Original Message-----
> From: webtest-admin@gate2.canoo.com [mailto:webtest-=20
> admin@gate2.canoo.com]On Behalf Of Colin O'Brien
> Sent: Monday, January 16, 2006 2:03 PM
> To: webtest
> Subject: [Webtest] Does <select/> have to be in a form...?
>
> Hi All,
>
>
>
> A short query about setSelectField=85 In order for the dropdown to be =20=

> recognised does the dropdown I=92m looking for have to be enclosed in =20=

> <form>=85</form> tags=85?
>
>
>
> The page I=92m testing has a select defined at line 127 but the first =20=

> <form/> starts at line 600+ so the select field doesn=92t appear =20
> inside any form tags and appears to be skipped with the page is =20
> loaded with htmlunit=85?
>
>
>
> Is this the expected behaviour=85?
>
>
>
> Release 1.7_R1121
>
> Log:
>
> *************************************************
>
> [testSpec] INFO  16 Jan 2006 18:49:20,234 [
>
> main]                            com.canoo.webtest.steps.Step () - =20
> >>>> Start Step: setSelectField "Select the RO Users" (22/23)
>
>  [testSpec] INFO  16 Jan 2006 18:49:20,250 [
>
> main]                            com.canoo.webtest.steps.Step () - =20
> Running with: Canoo Webtest: R_1121.
>
>  [testSpec] INFO  16 Jan 2006 18:49:20,250 [
>
> main]                            com.canoo.webtest.steps.Step () - =20
> Exception thrown from this class: =20
> com.canoo.webtest.engine.StepFailedException
>
>  [testSpec] INFO  16 Jan 2006 18:49:20,250 [
>
> main]                            com.canoo.webtest.steps.Step () - =20
> Message was:No suitable form found having field named =20
> "my_communities_sel"
>
>  [testSpec] INFO  16 Jan 2006 18:49:20,312 [
>
> main]                       com.canoo.webtest.ant.WebtestTask () - =20
> Test report successfully created.
>
> *************************************************
>
>
>
> Regards,
>
> Colin.
>
>

--=20
The goal [of unit test] is a MTBD (Mean Time Between Defects) that =20
doesn't make you unhappy.
   - Kent L. Beck,  junit@yahoogroups.com, 05  mai 2002