Skip to main content

Else

else is executed if all if and else if conditions are false. In this case, no condition is checked; the code inside the else block runs directly. It is used when you want to provide a general action for all other cases.

RpScript​

How to use
Pupet.OpenBrowser({ headless: false, browser: "Chrome" });
var pageResponse = Pupet.Visit("https://erametricras.com/");
var waitOptionForVisible = Pupet.WaitOptionForVisible(true, 10000);
var products= Pupet.ElementIsExists(pageresponse.page, "li#menu-item-1502 > a:nth-child(1) > div.tdb-menu-item-text", null, WaitOptionForVisible);
if (products== false) {
Assert.Throw("The Products button is not available.");
}
else {
Pupet.Click(pageresponse.page, "li#menu-item-1502 > a:nth-child(1) > div.tdb-menu-item-text");
}
Pupet.CloseBrowser();

Extension​