How might you fill a text field without calling the sendKeys()?

872    Asked by BenButler in QA Testing , Asked on Feb 14, 2020
Answered by Ben Butler

It's a piece more slow than the sendKeys() strategy however we do have intentions to type in a text field. See the Java code given beneath.

JavascriptExecutor JS = (JavascriptExecutor)webdriver;

JS.executeScript("document.getElementById(User').value='test@test.com'");

JS.executeScript("document.getElementById('Pass').value='####'");



Your Answer

Interviews

Parent Categories