Selenium is one of the most popular open-source tools that facilitate test automation. In Selenium IDE, test scripts can be created in various programming languages like Java, C#, Python, etc. Selenium only allows the testing of web applications. Selenium is a suite of tools, each tool serves different testing needs.
Selenium IDE Commands
In Selenium IDE, the commands that create test cases are referred to as Selenese commands. Selenese are sets of commands that are used in Selenium ide to perform various operations on the web. It is majorly used to develop coding scripts in Selenium IDE. The element locator helps Selenium to decide which HTML element a command will refer to. All of these locators are detectable using Mozilla's FirePath and FireBug plugins.
One can perform multiple actions on web browsers by using Selenese:
- Evaluating web pages.
- Checking for broken links.
- Testing of input fields.
- Checking for specific content.
- Submission of forms and table data.
- Testing window size and mouse options.
- Evaluating alerts.
Types of Selenium Commands
Selenium commands(Selenese) are classified under three categories, Actions, Accessors, and Assertions.
Actions
Actions are selenium IDE commands that control the status of an application. Actions commands provide multiple events like:
- Click on this link.
- Decide and select an option.
- Click on this box.
For some reason, if an action fails, the execution of the current test automatically stops. Below are the frequently used actions commands:
|
This command opens specific URLs, and this command is used for both relative and absolute URLs.
|
This command opens a specific URL in the browser.
|
This command finds a single web element using different strategies.
|
This command allows clicking on web elements like links, buttons, checkboxes, or radio buttons.
|
This command allows you to click on an element with the help of pointers and coordinate strings.
|
This command allows a double click on the web element based on the specified content.
|
This command moves the focus to a specified web element.
|
This command changes the web element's background color to yellow for priority, which is essential for debugging purposes.
|
This command allows clicking on the refresh button.
|
This command allows waiting for a specific amount of time in milliseconds.
|
This command closes the current browser window that the WebDriver is using.
|
Upon releasing the mouse button, this command reproduces the event that occurs.
|
Upon releasing the mouse button at a particular location, this command reproduces the event that occurs.
|
This command is used to perform left mouse click operation.
|
Upon releasing the left mouse button at a particular location, this command reproduces the event that occurs.
|
This command prints specified messages or statements on the console.
|
Accessors
Accessors are the selenium commands that are used to check the state of the application and store the result in a variable. Accessors commands are generally used to automatically generate Assertions. Below are some commonly used Accessors commands:
|
This command fetches the JavaScript confirmation generated during past action.
|
This command extracts the text from the cells of the table.
|
This command fetches the title of the current page.
|
This command fetches the content/text of an element.
|
This command prints all the Windows names in an array.
|
This command prints all the Windows titles in an array.
|
This command fetches the whole text of the page.
|
This command fetches the actual URL of the current page.
|
This command fetches the element attributes' value.
|
This command prints the IDs of all input fields on the page.
|
This command prints the IDs of all links on the page.
|
This command checks if the specific element is visible or not.
|
Assertions
Assertions are the selenium commands that enable the testers to check/verify the status of an application. Different types of Assertions are:
- assert: If the assert fails, the test will be terminated automatically.
- verify: It doesn't stop execution when verify fails, but returns logging failure.
- waitfor: It'll hold up for the condition until it becomes True.
|
This command verifies the selected option in the dropdown that meets the optionsSpecifier.
|
This command confirms an attribute of an element; utilized with the accessorstoreAttribute.
|
This command conforms Holds up for mistake; utilized with the accessorassertErrorOnNext.
|
This command confirms the window id; utilized with the accessorstoreAllWindowIds.
|
This command confirms all links; utilized with the accessorstoreAllLinks.
|
This command confirms the alarm content; utilized with accessorstoreAlert.
|
This command confirms the body content; utilized with the accessorstoreBodyText.
|
This command confirms the button which is utilized with accessorstoreAllButtons.
|
This command conforms holds up for the alert; utilized with the accessorstoreAlert.
|
This command waits for the confirmation, utilized with accessor storeConfirmationPresent.
|
Similar Reads
Software Testing Tutorial Software testing is an important part of the software development lifecycle that involves verifying and validating whether a software application works as expected. It ensures reliable, correct, secure, and high-performing software across web, mobile applications, cloud, and CI/CD pipelines in DevOp
10 min read
What is Software Testing? Software testing is an important process in the Software Development Lifecycle(SDLC). It involves verifying and validating that a Software Application is free of bugs, meets the technical requirements set by its Design and Development, and satisfies user requirements efficiently and effectively.Here
11 min read
Principles of Software testing - Software Testing Software testing is an important aspect of software development, ensuring that applications function correctly and meet user expectations. From test planning to execution, analysis and understanding these principles help testers in creating a more structured and focused approach to software testing,
3 min read
Software Development Life Cycle (SDLC) Software Development Life Cycle (SDLC) is a structured process that is used to design, develop, and test high-quality software. SDLC, or software development life cycle, is a methodology that defines the entire procedure of software development step-by-step. The goal of the SDLC life cycle model is
8 min read
Software Testing Life Cycle (STLC) The Software Testing Life Cycle (STLC) is a process that verifies whether the Software Quality meets the expectations or not. STLC is an important process that provides a simple approach to testing through the step-by-step process, which we are discussing here. Software Testing Life Cycle (STLC) is
7 min read
Types of Software Testing Software testing is a important aspect of software development life-cycle that ensures a product works correctly, meets user expectations, and is free of bugs. There are different types of software testing, each designed to validate specific aspects of an application, such as functionality, performa
15+ min read
Levels of Software Testing Software Testing is an important part of the Software Development Life Cycle which is help to verify the product is working as expected or not. In SDLC, we used different levels of testing to find bugs and errors. Here we are learning those Levels of Testing in detail.Table of ContentWhat Are the Le
4 min read
Test Maturity Model - Software Testing The Test Maturity Model (TMM) in software testing is a framework for assessing the software testing process to improve it. It is based on the Capability Maturity Model(CMM). It was first produced by the Illinois Institute of Technology to assess the maturity of the test processes and to provide targ
8 min read
SDLC MODELS
TYPES OF TESTING