Usetutoringspotscode to get 8% OFF on your first order!

  • time icon24/7 online - support@tutoringspots.com
  • phone icon1-316-444-1378 or 44-141-628-6690
  • login iconLogin

StaleElementReferenceException

https://paste.ofcode.org/kAfW4zJk2Vt45YEkKzhPDv

if (rowList.size() == 0) I click on column name and wait case will appear. When rowList.size() != 0 my test should go to  if (verifyRow(predicates, i)) { if true to this action in method,  }else if (!verifyRow(predicates, i)){ my method should click on selector 10 times and wait 10s after click and wait untill case will appear.

If case after clicking will appear then my test should do

List<WebElement> row = rowList.get(i);
                    WebElement cell = row.get(1);
                    action.doubleClick(cell).perform();
                    selectionResult.addMatchedRow(i);

this action.

For now I have error

org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document (Session info: chrome=81.0.4044.138) For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/stale_element_reference.html Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’

HERE:

  }else if (!verifyRow(predicates, i)){
                    for (int j = 0; j < 10; j++) {
                        try {
                            getDriver().findElement(selector).click();
                        } catch (StaleElementReferenceException e) {
                            //  HERE I HAVE ERROR

                        }

Loop works once and then i get error.

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes