|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Conditional using HTMLUnitGood Morning,
I am trying to write tests for an ecommerce site. I select the first product on a page using an xpath expression. The problem is, this may or may not have a ‘select size’ or ‘select color’ drop down (for example, if the first product is a bottle of perfume).
Using HTML unit – how can I set these select boxes only if they are present on the page. Is there a way to use conditional logic within an html unit test? Or else is there a way to skip a tag and continue the test if the element is not on the page.
Thanks!
Brendan Kelly
------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Jameleon-developers mailing list Jameleon-developers@... https://lists.sourceforge.net/lists/listinfo/jameleon-developers |
|
|
Re: [Jameleon-users] Conditional using HTMLUnitHi Brendan,
The short answer is yes.
The long answer is there are two ways to do this:
- Write your own custom tag (this is the recommended way)
- creating a simple custom tag - http://jameleon.sourceforge.net/getting-started/customFunctionalPoints.html
- for an htmlunit custom tag - http://jameleon.sourceforge.net/htmlunit-plugin/getting-started/customFunctionalPoints.html
- some documentation on the HtmlUnitFunctionTag - http://jameleon.sourceforge.net/htmlunit-plugin/apidocs/net/sf/jameleon/plugin/htmlunit/HtmlUnitFunctionTag.html
- Use Jelly tags http://commons.apache.org/jelly/tags.html
There is an <if/> tag. I have some examples in the tests for jameleon-core if you learn by example. http://jameleon.svn.sourceforge.net/viewvc/jameleon/trunk/jameleon-core/tst/xml/framework/skipIfOrganization.xml?revision=1185&view=markup
Hope this helps,
Christian
From: "jameleon-users@..." <jameleon-users@...> To: "jameleon-users@..." <jameleon-users@...>; "jameleon-developers@..." <jameleon-developers@...> Sent: Sunday, May 10, 2009 8:24:24 PM Subject: [Jameleon-users] Conditional using HTMLUnit Good Morning,
I am trying to write tests for an ecommerce site. I select the first product on a page using an xpath expression. The problem is, this may or may not have a ‘select size’ or ‘select color’ drop down (for example, if the first product is a bottle of perfume).
Using HTML unit – how can I set these select boxes only if they are present on the page. Is there a way to use conditional logic within an html unit test? Or else is there a way to skip a tag and continue the test if the element is not on the page.
Thanks!
Brendan Kelly
------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Jameleon-developers mailing list Jameleon-developers@... https://lists.sourceforge.net/lists/listinfo/jameleon-developers |
| Free embeddable forum powered by Nabble | Forum Help |