Unfortunately I did not find any existing solution for my problem on stackoverflow. So, can someone help.
I want to get the text of an html-element. I tried this:
var element = driver.findElement(webdriver.By.className("credits")).getText();
console.log(element);
Unfortunately this did not work so far.
Someone posted an answer and deleted it seconds after it...thank you anyway:
For you information, this works fine for me:
var textPromise = driver.findElement(webdriver.By.className("credits")).getText();
textPromise.then((text) => {
console.log(text);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With