Condition

1 view
Skip to first unread message

Clément Beaujoin

unread,
Apr 2, 2009, 9:07:06 AM4/2/09
to CubicEx-discuss
* Add condition property to all commands, this enables you to
prevent the command from running. The condition property is a
expression.

I do not understand what you mean by expression, what does it look
like?

Ronald Mathies

unread,
Apr 2, 2009, 11:06:12 AM4/2/09
to CubicEx-discuss
Expressions can be for example a Javascript expression. It contains
the same functionality which is used by the StoreExpression command.
The result is iether "true" or "1" or "false" or "0".

In case the result is "false" or "0" then the command is not executed.

Sample would be:

javascript{"${myVar}"=="value"}

Which would return true or false.
(in this sample the ${myVar} would be replaced from a stored value)

Nelson

unread,
Apr 3, 2009, 9:33:50 AM4/3/09
to CubicEx-discuss
Can you explain us how does it work.
I tried to fill into "expression" field (VerifyEditable) :
expression : javascript{document.getElementsByName('name')=='myName'}
target : //*/input[@name='inputName']

and it doesn't work, I have an exception.
Could you show me an example?

Thx

Ronald Mathies

unread,
Apr 3, 2009, 2:51:48 PM4/3/09
to CubicEx-discuss
Note that, by default, the expression will run in the context of the
"selenium" object itself, so this will refer to the Selenium object.
Use window to refer to the window of your application, e.g.
window.document.getElementById('foo')

If you need to use a locator to refer to a single element in your
application page, you can use this.browserbot.findElement("id=foo")
where "id=foo" is your locator.
Reply all
Reply to author
Forward
0 new messages