Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

How to type into a text box using Selenium WebDriver?

Category: Selenium WebDriver

The following are the two different ways you can type text into the text box fields in Selenium:

Using sendKeys():
– driver.findElement().sendKeys();

Using JavascriptExecutor:
– JavascriptExecutor jse = (JavascriptExecutor)driver;
– jse.executeScript(“document.getElementById(“username”).setAttribute(‘value’,’hireqa’)”);

Leave a Reply

Your email address will not be published. Required fields are marked *