Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
201 views
in Selenium by
recategorized by
when you do a refresh of the web page our driver will no longer be having the element in the cache
in order to update our driver as well what do we need to do?
something to do with getWindowhandle();?

1 Answer

0 like 0 dislike
by
 
Best answer

reassign webelement.

e.g.

If you are doing

WebElement textbox = driver.findElement(By.tagName("textbox"));

driver.refresh();

textbox.sendKeys();

you will see above exception.

 

To avoid it do:

WebElement textbox = driver.findElement(By.tagName("textbox"));

driver.refresh();

textbox = driver.findElement(By.tagName("textbox"));

textbox.sendKeys();

 


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...