desc.WaitForJavaScriptCondition.txt Maven / Gradle / Ivy
Waits for the given JavaScript condition.
Fails if timeout expires before the condition is met.
*Example:*
| *** Variables *** |
| ${js_condition} | return (xmlhttp.readyState >= 2 && xmlhttp.status == 200) |
| ${js_timeout_in_seconds} | 5 |
| *** Test Cases *** |
| Ajax Test |
| [Tags] | ajax-test |
| `Navigate To` | http://www.w3schools.com/ajax/default.asp |
| `Click Element` | css=button[type="button"] |
| ${jsCondition}= | `Wait For JavaScript Condition` | ${js_condition} | ${js_timeout_in_seconds} |
| `Element Text Should Be` | css=#myDiv > p | AJAX is not a new programming language. |
=>
| ${jsCondition} = True