Issue
I executed JavaScript using this advice and I want to return a value from this script.
Solution
You can just return the value like this:
Java:
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("return document.title");
Python:
driver.execute_script("return document.title")
driver.execute_script("return document.querySelector('.somecssclass')")
Answered By - Jochen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.