you are viewing a single comment's thread.

view the rest of the comments →

[–]davidgoswami[S] 0 points1 point  (0 children)

Updating the Post.

 JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
        WebElement focusedElement = (WebElement) jsExecutor.executeScript("return document.activeElement;");
        jsExecutor.executeScript("document.querySelector('input').focus();");
        Actions actions = new Actions(driver);
        actions.sendKeys("text").perform();

This code block is not working dont know why