Outputs the exact phrase put into the statement. Eg: echo "Now checking validation" will cause a new line, the phrase "Now checking validation" to be printed, another new line and then the output of the test. Handy when reviewing logs to separate multiple test cases.
tells the browser to open a specific page. This is useful if you don’t want the test to navigate to a page and instead just want it to go straight there. This can be a relative path so you can use it on both a testing and live environment.
type will place text in an input. Typekeys will actually mimic entering one key at a time so any onkeyup() functionality you might have going on will work. We have autocomplete search boxes that required TypeKeys.
Verifies that text appears on the page. It can be dynamic text that was loaded with ajax. If it’s on the page in the active window at the time this command is called, it’ll find it.
Verifies the value of an input field. Provide the id of the input as the target and the value is the text you’re expecting.
tell the test to click something on the page. The target can be referenced with the element ID or xPath as with the other commands.
Useful for form submissions. Many times when you’re in record mode and click a submit button, selenium will only record a “click” command. This will break your test commands following the form submission where you verify the presence of a success message or form values because the next page hasn’t loaded yet. The “wait” portion will wait to continue the testing when the next page has fully loaded.
select an option in a select box by providing the id of the select box and the option value.
Tell the test to pause for a while. Enter a target of 3000 for 3 seconds. I started using this command frequently at first, especially when testing ajax. However, as I went on I found better alternatives since a TCP/IP connection isn’t always reliable and doesn’t get returned on time, every time.
This command tells the test to wait until an element, often returned by ajax, is visible before continuing.