Selenium commands are also called selense, which are the set of commands that run your tests. In a test script, these commands are executed in a sequence.
Selenium provides a rich set of commands for fully testing your web application according to your test cases.
By using Selenium commands (selense), QA engineers can test the existence of UI elements based on their HTML tags, test for specific content, test for broken links, input fields, selection list options, submitting forms, table data among other elements, windows size, mouse positions, alerts, Ajax functionality, pop up windows, event handling, and many other mouse-application features.
In general, Selenium commands come in three types: Actions, Accessors, and Assertions.
Actions do thing like "Click this link", "ClickAndWait", "WaitForPageToLoad" and select that option. If an action fails, or has an error, the execution of the current test is stopped. Actions are generally used for human action simulation when interacting with web elements.
Accessors are used to store the results in variables. For example, "StoreTitle", "StoreVariable". They are also used to automatically generate Assertions.
Assertion are like Accessors, but they verify that the state of the application conforms to what is expected. Examples include “make sure the page title is X” and “verify that this checkbox is checked”.
Selenium Assertions has 3 modes: “assert”, “verify”, and ” waitFor”. For example, you can “assertText”, “verifyText” and “waitForText”.
When an “assert” fails, the test is aborted.
When a “verify” fails, the test will continue execution, logging the failure. This allows a single “assert” to ensure that the application is on the correct page, followed by a bunch of “verify” assertions to test form field values, labels, etc.
“waitFor” commands wait for some condition to become true (which can be useful for testing Ajax applications). They will succeed immediately if the condition is already true. However, they will fail and halt the test if the condition does not become true within the current timeout setting.