InterviewSolution
Saved Bookmarks
| 1. |
How can I type text into the text box without using the sendKeys() function? |
|
Answer» We can use the following piece of CODE to TYPE text into the text box WITHOUT using the sendKeys() function: // To INITIALIZE js objectJavascriptExecutor JS = (JavascriptExecutor)webdriver;// To ENTER usernameJS.executeScript("document.getElementById('User').value='InterviewBit.com'");// To enter passwordJS.executeScript("document.getElementById('Pass').value='tester value'"); |
|