Exploring the WebExecute
function, I would like to know how can I send key (or TypeElement) to the element in focus. Here is a toy code using Google.
StartWebSession["Chrome"]
WebExecute["OpenPage" -> "www.google.com"]
WebExecute["ClickElement" -> "XPath" -> "//input[@name = 'q']"];
Now that the text area is selected, I tried to implement this post Javascript solution (with no success) using:
WebExecute["JavascriptExecute"->"browser.actions().sendKeys('Test').perform();"]
Any clue on how to do this in Mathematica?
Note: I know that for this toy code I can type in the text area using:
WebExecute["TypeElement" -> {First@WebExecute["LocateElements" -> "XPath" -> "//input[@name = 'q']"], "Test"}]
But my real case is more complex than this, and type in the focus area should work.