How to write scenario outline in cucumber

A Scenario Outline is run once for each row in the Examples section beneath it (not counting the first row). The way this works is via placeholders. See the below example

Create Step defination now. Below are the step definations.

It’s very useful.

How to use JavascriptExecutor in Selenium or Appium

Below is the way to use JavascriptExecutor in Selenium or Appium.

Write Dynamic CSS Selector in Selenium using multiple ways

Selenium supports 8 locators, please check below screenshot.

Symbol used while writing CSS selector in Selenium Webdriver

Different ways to write CSS selector in Selenium to identify Dynamic elements

1. Find CSS Selector using Single Attribute

2. Find CSS using Multiple attributes.

3. Find CSS using id and Class name

The class name generally will not be unique so always try class name with some other attributes.

4. Find CSS using contains

In CSS we will use * symbol to check particular attribute contains that value or not

In below example, it will partially check if link title contains “Password lost ” if yes then it will match.

I have taken the only link in this example but you can take any tag and any attribute.

5. Find CSS using Start-with

In below example, I have taken the only link but you can take any element.

6. Find CSS using ends-with

Now you must be having a clear picture in mind for CSS Selector in Selenium and I would recommend trying all technique at least once using same or some other applications.

Click link CSS Selector Part 2 CSS Selector Part 2

Check link for Dynamic XPath

Please give your suggestions at