Categories

1 Answer

Aug 22, 2019

// To initialize js object

JavascriptExecutor JS = (JavascriptExecutor)webdriver;

// To enter username

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

// To enter password

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

1

2

3

4

5

6

// To initialize js object

JavascriptExecutor JS = (JavascriptExecutor)webdriver;

// To enter username

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

// To enter password

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

Learn JavaScriptExecutor in Selenium with Examples

Click here to read more about Selenium
Click here to read more about Insurance

Related questions

Madanswer
Aug 19, 2019 in Selenium
Aug 22, 2019 in Selenium
Aug 22, 2019 in Selenium
...