[Solved] mocha/chai.js testing harness: https calls do not work from after() function

I believe I have found a solution. In after(), if you asynchronously invoke some endpoint on a service external to your testing environment, then that asynchronous call is queued and not immediately executed. This is the nature of calling asynchronous functions in node.js. Well, if there is no logic after the after() call, then mocha … Read more

[Solved] How to get the text of an anchor tag selected by xPath() using selenium and Mocha

You can try this approach: driver.findElement(By.xpath(“//a[contains(@class, ‘user-name m-r-sm text-muted welcome-message’)]”)).getText().then(function(text){ console.log(“Username : ” + text); }); you only need to search via findElement (not findElements) and directly extract the text before the function part UPDATE: Sometimes the object is not really hidden, but also not in the viewport, then gettext() also returns an empty String. … Read more