selenium-cucumber-js icon indicating copy to clipboard operation
selenium-cucumber-js copied to clipboard

Throwing exception

Open Elensn opened this issue 5 years ago • 0 comments
trafficstars

Is it possible to throw an exception on purpose to make the step failing?

Example:

return driver.wait(until.elementLocated(by.xpath("/html/body/div[13]/div/div[4]"))).getText().then(function (text){
                console.log("Notify: " + text);

                if(text !== "Updated successfully"){
                        throw exception
                   
                }
        });

Elensn avatar Nov 18 '20 15:11 Elensn