
- Selenium - Home
- Selenium - Overview
- Selenium - Components
- Selenium - Automation Testing
- Selenium - Environment Setup
- Selenium - Remote Control
- Selenium - IDE Introduction
- Selenium - Features
- Selenium - Limitations
- Selenium - Installation
- Selenium - Creating Tests
- Selenium - Creating Script
- Selenium - Control Flow
- Selenium - Store Variables
- Selenium - Alerts & Popups
- Selenium - Selenese Commands
- Selenium - Actions Commands
- Selenium - Accessors Commands
- Selenium - Assertions Commands
- Selenium - Assert/Verify Methods
- Selenium - Locating Strategies
- Selenium - Script Debugging
- Selenium - Verification Points
- Selenium - Pattern Matching
- Selenium - JSON Data File
- Selenium - Browser Execution
- Selenium - User Extensions
- Selenium - Code Export
- Selenium - Emitting Code
- Selenium - JavaScript Functions
- Selenium - Plugins
- Selenium WebDriver Tutorial
- Selenium - Introduction
- Selenium WebDriver vs RC
- Selenium - Installation
- Selenium - First Test Script
- Selenium - Driver Sessions
- Selenium - Browser Options
- Selenium - Chrome Options
- Selenium - Edge Options
- Selenium - Firefox Options
- Selenium - Safari Options
- Selenium - Double Click
- Selenium - Right Click
- HTML Report in Python
- Handling Edit Boxes
- Selenium - Single Elements
- Selenium - Multiple Elements
- Selenium Web Elements
- Selenium - File Upload
- Selenium - Locator Strategies
- Selenium - Relative Locators
- Selenium - Finders
- Selenium - Find All Links
- Selenium - User Interactions
- Selenium - WebElement Commands
- Selenium - Browser Interactions
- Selenium - Browser Commands
- Selenium - Browser Navigation
- Selenium - Alerts & Popups
- Selenium - Handling Forms
- Selenium - Windows and Tabs
- Selenium - Handling Links
- Selenium - Input Boxes
- Selenium - Radio Button
- Selenium - Checkboxes
- Selenium - Dropdown Box
- Selenium - Handling IFrames
- Selenium - Handling Cookies
- Selenium - Date Time Picker
- Selenium - Dynamic Web Tables
- Selenium - Actions Class
- Selenium - Action Class
- Selenium - Keyboard Events
- Selenium - Key Up/Down
- Selenium - Copy and Paste
- Selenium - Handle Special Keys
- Selenium - Mouse Events
- Selenium - Drag and Drop
- Selenium - Pen Events
- Selenium - Scroll Operations
- Selenium - Waiting Strategies
- Selenium - Explicit/Implicit Wait
- Selenium - Support Features
- Selenium - Multi Select
- Selenium - Wait Support
- Selenium - Select Support
- Selenium - Color Support
- Selenium - ThreadGuard
- Selenium - Errors & Logging
- Selenium - Exception Handling
- Selenium - Miscellaneous
- Selenium - Handling Ajax Calls
- Selenium - JSON Data File
- Selenium - CSV Data File
- Selenium - Excel Data File
- Selenium - Cross Browser Testing
- Selenium - Multi Browser Testing
- Selenium - Multi Windows Testing
- Selenium - JavaScript Executor
- Selenium - Headless Execution
- Selenium - Capture Screenshots
- Selenium - Capture Videos
- Selenium - Page Object Model
- Selenium - Page Factory
- Selenium - Record & Playback
- Selenium - Frameworks
- Selenium - Browsing Context
- Selenium - DevTools
- Selenium Grid Tutorial
- Selenium - Overview
- Selenium - Architecture
- Selenium - Components
- Selenium - Configuration
- Selenium - Create Test Script
- Selenium - Test Execution
- Selenium - Endpoints
- Selenium - Customizing a Node
- Selenium Reporting Tools
- Selenium - Reporting Tools
- Selenium - TestNG
- Selenium - JUnit
- Selenium - Allure
- Selenium & other Technologies
- Selenium - Java Tutorial
- Selenium - Python Tutorial
- Selenium - C# Tutorial
- Selenium - Javascript Tutorial
- Selenium - Kotlin Tutorial
- Selenium - Ruby Tutorial
- Selenium - Maven & Jenkins
- Selenium - Database Testing
- Selenium - LogExpert Logging
- Selenium - Log4j Logging
- Selenium - Robot Framework
- Selenium - AutoIT
- Selenium - Flash Testing
- Selenium - Apache Ant
- Selenium - Github Tutorial
- Selenium - SoapUI
- Selenium - Cucumber
- Selenium - IntelliJ
- Selenium - XPath
- Selenium Miscellaneous Concepts
- Selenium - IE Driver
- Selenium - Automation Frameworks
- Selenium - Keyword Driven Framework
- Selenium - Data Driven Framework
- Selenium - Hybrid Driven Framework
- Selenium - SSL Certificate Error
- Selenium - Alternatives
Selenium IDE - Pattern Matching
Selenium IDE can be used for pattern matching for the tests especially for tests requiring verification scenarios. Like locators, patterns are a type of parameter frequently used by Selenium. It allows users to describe patterns with the help of special characters. Many times, the text that we would like to verify is dynamic, in that case, pattern matching is very useful.
Pattern matching is commonly used with all the verification point commands like verify text, verify not text, verify title, verify value, verify, assert text, assert alert, assert not text, assert prompt, assert selected value, assert title, assert not selected value, assert selected label, and so on.
Different Ways of Pattern Matching
Globbing
Regular Expressions
Exact Matching
Globbing
Globbing is used to match a string with respect to a glob(which is the wild character expression). It is commonly used for file matching patterns in Linux or Windows while searching for a certain file type like *.doc, *.jpg, and so on.
There are multiple ways to use globbing in Selenium like * which is used to match any count or order of characters ? which is used to match a unique character, and [] which is used to match any one character provided within the brackets. It is a character class. For example, [0-9] will match any digit. The pattern matching with globbing is by default available in Selenium and it is optional to mention the keyword glob in the test step in the Selenium IDE.
Let us take the example of the below page, where we would verify the text Alerts and header Selenium - Automation Practice using the globbing pattern matching.

The steps to be followed are listed below −
Step 1 − Click on the Selenium IDE extension visible on the browser after its installation.
Step 2 − Selenium IDE should be launched along with it, a welcome message should be displayed with the version of the tool. In the below image, the version installed is 3.17.2.
Along with this, it gives us the option to select what we would like to do with the tool, like Record a new test in a new project, Open an existing project, Create a new project, and Close Selenium IDE.
Step 3 − Click on the Create a new project link, then enter a project name, say, Test7 under the Please provide a name for your new project. Finally, we would click on the OK button.
Step 4 − We would have the workspace ready in the Selenium IDE now.
Step 5 − Enter open in the Command field, and https://www.tutorialspoint.com/selenium/ in the Target field to launch the application.
Step 6 − Enter assert text in the Command field, xpath=/html/body/main/div/div/div[2]/h1 in the Target field, and glob: Alert* in the Value field. Please note, xpath=/html/body/main/div/div/div[2]/h1 is the text and glob: Alert* is the value to be a matched pattern.
Step 7 − Enter assert text in the Command field, xpath=/html/body/div/header/div[2]/h1 in the Target field, and glob: Selenium - Automation* in the Value field. Please note, xpath=/html/body/div/header/div[2]/h1 is the header and glob: Selenium - Automation* is the value to be a matched pattern.
Step 8 − Enter close in the Command field to close the browser window.

Step 9 − Click on the three dots appearing at the left pane, then select the Rename option.
Step 10 − Enter a name, say Test14 under the Rename Test case field, then click on Rename. The entered name would appear on the left of Selenium IDE.
Step 11 − Click on the Run all tests from the top, and wait for the test execution to complete. In our example, we would see Runs: 1, Failures: 0, and a green bar denoting the test ran successfully without any failures. Also, the message Test14 completed successfully appeared under the Log.
In the example above, we had verified the texts with the help of the globbing.
Exact Matching
Exact matching is used to match a string as it is present. For example, if an exact match with the string value is required, the exact pattern can be used. In exact matching, the operator * works as a normal character rather than for pattern matching wildcard characters. Let us take the same example as discussed above and use exact pattern technique.
The steps to be followed are listed below −
Step 1 − Follow Steps 1 to 5 of the previous example.
Step 2 − Enter assert text in the Command field, xpath=/html/body/main/div/div/div[2]/h1 in the Target field, and exact: Alerts in the Value field. Please note, xpath=/html/body/main/div/div/div[2]/h1 is the text and exact: Alerts is the value to be matched exactly.
Step 3 − Enter assert text in the Command field, xpath=/html/body/div/header/div[2]/h1 in the Target field, and exact: Selenium - Automation Practice in the Value field. Please note, xpath=/html/body/div/header/div[2]/h1 is the header and exact: Selenium - Automation Practice is the value to be matched exactly.
Step 4 − Follow Steps 8 to 11 of the previous example.
Regular Expressions
Regular expressions are the most useful among the pattern matching techniques available. Selenium supports the complete set of regular expression patterns that Javascript supports. Hence the users are no longer limited by *, ? and [] globbing patterns.
To use RegEx patterns, we need to prefix with either "regexp:" or "regexpi:". The prefix "regexpi" is case-insensitive. The glob: and the exact: patterns are the subsets of the Regular Expression patterns. Everything that is done with glob: or exact: can be accomplished with the help of RegExp.
There is more information on regular expressions available in the below link −
https://www.tutorialspoint.com/javascript/javascript_regexp_object.htm
This concludes our comprehensive take on the tutorial on Selenium IDE - Pattern Matching. Weve started with describing different ways of Pattern Matching like globbing, regular expression, and exact match and how to use them with Selenium.
This equips you with in-depth knowledge of the Pattern Matching in Selenium IDE. It is wise to keep practicing what youve learned and exploring others relevant to Selenium to deepen your understanding and expand your horizons