InfoTechSite
CS/IT Tutorials Collections

Common Selenium IDE Commands Lists

Pinterest LinkedIn Tumblr
The set of selenium IDE commands that runs your test are called selenese and the sequence of commands is called test scripts. We have already introduced on some of the basic selenium commands and the common types of selenium commands on the previous articles. In this post, we are writing in detail about the common selenium IDE commands included under actions, accessors and assertions.

Selenium IDE Commands Under Actions

These are the commands that manipulate the state of the applications.  Following are the selenium IDE commands fall under Actions.

Open – Opens the URL and waits for the page load before proceeding. It accepts both the relative and absolute URLs.

Click – Clicks on the target element such as links, buttons, checkbox, radio buttons.

Click at – Clicks on target elements such as links, buttons, checkbox, or radio button. The coordinates are relative to the target element where 0,0 is the top left corner of the element.

Double click – Double clicks on the target element such as links, buttons, checkbox, and radio buttons.

Double click at – It double clicks on target elements such as links, buttons, checkbox, or radio button. The coordinates are relative to the target element where 0,0 is the top left corner of the element.

Type – It sets the value of an input field, as though you typed it in. You can also use this command to set the value of combo boxes, check boxes, etc.

Select – This command will select an element from a drop-down menu using an option locator. Option locators provide different ways of specifying a select element such as label=, value=, id=, index=.

Select frame – It selects a frame within the current window. You may invoke this command multiple times to select a nested frame. In order to select the parent frame, you should use “relative=parent” as a locator.

Select window – This command will select a popup window using a window locator. Once a popup window has been selected, all commands will go to that window.

Add selection – Add a selection to the set of options in a multi-select element.

Remove selection – It will remove a selection from the set of selected options in a multi-select element using an option locator.

Selenium IDE Commands Under Accessors

Here are the commands that examine the state of the application and stores that result in a variable. Following are the selenium IDE commands fall under accessors.

Store – It saves a target string as a variable for reuse purpose. You can enter the variable name on target field and value of the variable on the value field.

Store attribute – This command will get the value of an element attribute. You will require to use attribute locator and variable name to use with store attribute. Where attribute locator is an element locator followed by an @ sign and then the name of the attribute. So, you can use the variable name either to store an expression result in or reference for a check.

Store text – It gets the text of an element and stores it for later use. So, you can use this command for any element containing text. Element locator should be specified on the target field and the variable to store element text to value field.

Store value – This command will get the value of an element and stores it for reuse purpose. It will work for any input type elements. You should use element locator on target field and variable name on value field.

Store title – It will get the title of the current page and stores on variable provided.

Store XPath count – It gets the number of nodes that match the specified XPath, eg. “//h2” would give the number of h2 tags.

Selenium IDE Commands Under Assertions

Assertions will verify the state of the application and confirms whether the elements or their properties found as expected. There will be three types of selenium IDE commands assert, verify and wait for fall under assertions.

Verify Commands Under Assertions

Verify – It is a soft assert that a variable is an expected value where the variable’s value will convert to a string for comparison. So, it requires to provide the variable name and expected value.

Verify checked – You can use this command to verify whether the toggle buttons such as checkbox and radio buttons checked or not.  You have to specify an element locator on target field.

Verify not checked – You can use this command to verify whether the toggle buttons such as checkbox and radio buttons checked or not.

Verify editable – You can use this command to verify whether the specified input element is editable and not disabled. You have to provide an element locator to verify the element editable.

Verify not editable – You can use this command to verify whether the specified input element is not editable and disabled.

Verify element present – It will verify whether the specified element is somewhere on the page. You have to provide an element locator to verify the element present.

Verify element not present – It will verify whether the specified element is not somewhere on the page.

Verify selected value – It will verify whether the expected element has been chosen in a select menu by its option attribute. You should specify an element locator identifying a drop-down menu.

Verify text – It will verify whether the text of an element is present. Here you should provide an element locator and the text to verify.

Verify title – It will verify whether the title of the current page contains the provided text.

Verify value – It will verify the value of an input field. You should specify the locator and text for comparing with a value of input field.

Assert Commands Under Assertions

Assert – This command will check that a variable is an expected value.  It will convert the variable value to a string for comparison.

Assert alert – It will check whether an alert will render with the provided text.

Assert checked – You can use this command to check whether the target element checked. You have to specify an element locator on the target field.

Assert confirmation – It will confirm whether confirmation has been rendered.

Assert editable – This command will confirm whether the target element is editable. You have to specify an element locator on the target field.

Assert element present – It will confirm whether the target element is present somewhere on the page.

Assert selected value – This command will confirm the value attribute of the selected option in a drop-down element contains the provided value. It will require to provide an element locator identifying a drop-down menu and an exact string to match.

Assert prompt – It will confirm that a JavaScript prompt has been rendered.

Assert selected label – This command will confirm the label of the selected option in a drop-down element contains the provided value. It will require to provide an element locator identifying a drop-down menu and an exact string to match.

Assert text – It will confirm the text of an element contains the provided value. It will require to provide an element locator and an exact text string to match.

Assert title – It will confirm the title of the current page contains the provided text.

Assert value – It will confirm the value of an input field. While using this command for checkbox/radio elements, the value will be “on” or “off” depending on whether the element is checked or not.

WaitFor Commands Under Assertions

Wait for element editable – It waits for an element to be editable after loading the webpage. You have to specify an element locator and the amount of time to wait in milliseconds.

Wait for element not editable – It waits for an element not to be editable after loading the webpage. You have to specify an element locator and the amount of time to wait in milliseconds.

Wait for element present – It waits for a target element to be present on the page. You have to specify an element locator and the amount of time to wait in milliseconds.

Wait for element not present – It waits for a target element not to be present on the page. You have to specify an element locator and the amount of time to wait in milliseconds.

Wait for element visible – It waits for a target element to be visible on the page. You have to specify an element locator and the amount of time to wait in milliseconds.

Wait for element not visible – It waits for a target element not to be visible on the page. You have to specify an element locator and the amount of time to wait in milliseconds.

Read Next: Different Ways of Locating Elements in Selenium IDE

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Comments are closed.