Loop is not working properly - nightwatch
问题 I have this code, I want to go thru all the links available at the bottom of the page. After clicking them I want to make sure the URL opened is the correct one. I think the the recursive calls are done too early. Another issue is how can I do to tell that link belongs to certain URL. function links(browser, total_links) { if (total_links <= 0) { browser.end(); return; } console.log("Number of links: " + total_links); console.log('Flag1'); browser .waitForElementVisible('.bottom .socal>span