September 2018
Intermediate to advanced
764 pages
20h 6m
English
The final two step sees the WebDriver clicking on the Register button and waiting for the server to respond. For the click step, we just need to find the WebElement instance and invoke its click method. Define the following step definition at spec/cucumber/steps/interactions/element.js:
import { Given, When, Then } from 'cucumber';import { By } from 'selenium-webdriver';When(/^user clicks on the (?:"|')([\.#\w-]+)(?:"|') element$/, async function (selector) { const element = await this.driver.findElement(By.css(selector)); return element.click();});
Read now
Unlock full access