Hi everybody !
I keep having a lot of fun using Webtest ...
I've got a question that is more related to my "newbiness" (nice word,
huh ?) than
to a bug or something like that.
I want to have some tests execute only if a special condition appear.
I've tested the ifSTep, but
It seems like I don't understand the philosophy...
I thought it was something like a "if" control structure in Java
//do some tests
...
if (conditions){
//do some other tests
}
//do the end of your tests
...
For example, i have an html page that contains a form. If the form is
badly fill in, another field appear to be click on. Then the navigation
follows its route.
But with my test plan, the ifStep claims to fail (despite the fact only
the "condition" fail, not really the ifstep itself) and then the
end of my tests are not executed
Show you a chunk of code:
*setInputField(forLabel: "label_1 :", value: value_1)
clickButton(label: "label_2")
ifStep(){
condition(){
verifyXPath(xpath:"id('Error_block')")
}
groovy(file:"script_1.groovy")
setSelectField(htmlId:"optional_field",text:"#{groovy_property}")
clickButton(label: "label_opt")
}
setRadioButton(description: "Check radio button ", name: "radio_1",
value: value_2)
*Does Someone can help me to do what I want ?
Thanks to all
--
Pingwy
27, rue des arènes
49100 Angers