11 Execution Tests in Tools and from Command Line.
Various ways of execution test scripts.
Learning Objectives
Review
run test case
run test script
check a control’s state
Add Conditional in scripts: `
if
` and `unless
’Run all test scripts in a folder
Run test scripts from the command line
Test Case 11
A checkbox has two states: on and off. If a checkbox is already checked, the following step will uncheck it.
Tasks
Task 1. Check a checkbox safely
The following click a checkbox regardless of its state, it is more like a toggling operation.
driver.find_element(:id, “remember_me").click
To safely check a checkbox, we need to check its current state first. Only if it is not checked, click the checkbox.
Keep reading with a 7-day free trial
Subscribe to AgileWay’s Test Automation & Continuous Testing Blog to keep reading this post and get 7 days of free access to the full post archives.