Skip to main content

For in

The for...in loop is a construct used in JavaScript to iterate over all enumerable properties of an object. This loop iterates over the keys of the object, allowing you to access each key in sequence.

Parameters

  • LoopParameter - The name of the variable that will represent each key (or index) in the iteration.
  • LoopArray - The object or array you want to iterate over.

RpScript​

How to use
Pupet.OpenBrowser({ headless: false, browser: "Chrome" });
var pageresponse = Pupet.Visit("https://erametricras.com/");
var currentUrl = Pupet.GetUrl(pageresponse.page);
var expectedUrl = ""
var counter = 1;
var expectedUrls = [
"/enterprise-rpa/",
"/test-manager/",
"/capability-bots/"
];
for (var url1 in expectedUrls) {var counterStr = ConvertToString(counter);
var cssSelector = "()=>{document.querySelector('li.fontLoad:nth-child(1)>ul>li:nth-child(" + counterStr + ")>a').click();}"

currentUrl = Pupet.GetUrl(pageresponse.page);
counter++;

}

Pupet.CloseBrowser();

Extension​