org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document when tried to enter number

Sowmya

I was trying to enter Account number in a text field which is given in below HTML. But, the entered number is removed completely when I debug and at times only last digits are entered and at times failing.

<input id="consumerNonew" name="consumerNonew" type="text" countchar="" length="10" display="true" setvallocal="" value="940" maxlength="10" ng-blur="click($event,{s:&quot;consumerNonew&quot;,e:&quot;blur&quot;,p:&quot;dewaPaymentInpForm&quot;});" autocomplete="off" class="  validate  is-invalid-input">

Below is the code.

public void dwshortname_and_Contract_number_is_entered() throws Throwable {

    Thread.sleep(5000);

    driver.findElement(By.id("consumerNamenew")).sendKeys("TestUser");
    Thread.sleep(5000);         
    WebElement Accnumber= driver.findElement(By.id("consumerNonew"));

    final int MAXIMUM_WAIT_TIME = 120;
    final int MAX_STALE_ELEMENT_RETRIES = 10;

    WebDriverWait wait = new WebDriverWait(driver, MAXIMUM_WAIT_TIME);
    int retries = 0;
    while (true)
    {
        try
        {
            wait.until(ExpectedConditions.elementToBeClickable(By.id("consumerNonew"))).click();

              Accnumber.sendKeys("2012269940");
            Accnumber.sendKeys(Keys.TAB); 

            break;

        //  

        }
        catch (StaleElementReferenceException e)
        {
            if (retries < MAX_STALE_ELEMENT_RETRIES)
            {
                retries++;
                continue;
            }
            else
            {
                throw e;
            }


        }               

         }


 }
Waman

Sample code for robot class:

Robot RoboKey = new Robot();
RoboKey.delay(2000);
RoboKey.keyPress(KeyEvent.VK_2);
RoboKey.keyPress(KeyEvent.VK_0);
RoboKey.keyPress(KeyEvent.VK_1);

. . .

so on!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

org.openqa.selenium.StaleElementReferenceException: element is not attached to the page document while iterating through a List

From Dev

Selenium - Stale element reference: element is not attached to the page document in C#

From Dev

Selenium: stale element reference: element is not attached to the page document in Python

From Dev

how can I change my waitDriver to overcome `StaleElementReferenceException: stale element reference: element is not attached to the page document`

From Dev

Protractor - Failed: stale element reference: element is not attached to the page document

From Dev

Python Stale Element Reference: Element not attached to page document

From Dev

Message: stale element reference: element is not attached to the page document - Web Table Python

From Dev

I am getting this error while extracting text from elements. Message: stale element reference: element is not attached to the page document

From Dev

I am getting this error while extracting text from elements. Message: stale element reference: element is not attached to the page document

From Dev

Python with Selenium "element is not attached to the page document"

From Dev

Selenium stale element reference in for loop

From Dev

element is not attached to the page document

From Dev

Python Selenium: element is not attached to the page document error acting strangely

From Dev

Django: Selenium- stale element reference on browse

From Dev

Selenium WebDriver Stale Element Reference Exception for GWT

From Dev

StaleElementReferenceException: Element is no longer attached to the DOM

From Dev

WebdDriverJS/ NodeJS: 'Element is not attached to the page document' Error

From Dev

Protractor "stale element reference: element not attached... How do I fix this?

From Dev

Stale Element Reference Exception c# Selenium Webdriver

From Dev

Selenium returns stale element or NoSuchElementError although elements are on the page

From Dev

org.openqa.selenium.NoSuchElementException: Unable to locate element

From Dev

org.openqa.selenium.InvalidSelectorException - [object Text]. It should be an element

From Dev

Unable to locate element: org.openqa.selenium.NoSuchElementException

From Dev

org.openqa.selenium.InvalidSelectorException - [object Text]. It should be an element

From Dev

Java and Selenium Stale Element Error

From Dev

Python Selenium stale element exception

From Dev

Testing a 'stale' element with Selenium and rspec

From Dev

Exception in thread "main" org.openqa.selenium.NoSuchElementException: When trying to select an element from a pop-up using selenium

From Dev

selenium stale element when traversing pages using for-each loop

Related Related

  1. 1

    org.openqa.selenium.StaleElementReferenceException: element is not attached to the page document while iterating through a List

  2. 2

    Selenium - Stale element reference: element is not attached to the page document in C#

  3. 3

    Selenium: stale element reference: element is not attached to the page document in Python

  4. 4

    how can I change my waitDriver to overcome `StaleElementReferenceException: stale element reference: element is not attached to the page document`

  5. 5

    Protractor - Failed: stale element reference: element is not attached to the page document

  6. 6

    Python Stale Element Reference: Element not attached to page document

  7. 7

    Message: stale element reference: element is not attached to the page document - Web Table Python

  8. 8

    I am getting this error while extracting text from elements. Message: stale element reference: element is not attached to the page document

  9. 9

    I am getting this error while extracting text from elements. Message: stale element reference: element is not attached to the page document

  10. 10

    Python with Selenium "element is not attached to the page document"

  11. 11

    Selenium stale element reference in for loop

  12. 12

    element is not attached to the page document

  13. 13

    Python Selenium: element is not attached to the page document error acting strangely

  14. 14

    Django: Selenium- stale element reference on browse

  15. 15

    Selenium WebDriver Stale Element Reference Exception for GWT

  16. 16

    StaleElementReferenceException: Element is no longer attached to the DOM

  17. 17

    WebdDriverJS/ NodeJS: 'Element is not attached to the page document' Error

  18. 18

    Protractor "stale element reference: element not attached... How do I fix this?

  19. 19

    Stale Element Reference Exception c# Selenium Webdriver

  20. 20

    Selenium returns stale element or NoSuchElementError although elements are on the page

  21. 21

    org.openqa.selenium.NoSuchElementException: Unable to locate element

  22. 22

    org.openqa.selenium.InvalidSelectorException - [object Text]. It should be an element

  23. 23

    Unable to locate element: org.openqa.selenium.NoSuchElementException

  24. 24

    org.openqa.selenium.InvalidSelectorException - [object Text]. It should be an element

  25. 25

    Java and Selenium Stale Element Error

  26. 26

    Python Selenium stale element exception

  27. 27

    Testing a 'stale' element with Selenium and rspec

  28. 28

    Exception in thread "main" org.openqa.selenium.NoSuchElementException: When trying to select an element from a pop-up using selenium

  29. 29

    selenium stale element when traversing pages using for-each loop

HotTag

Archive