How to Handle Stale Element Exception in Selenium with Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

ความคิดเห็น • 59

  • @keshavdwivedi5192
    @keshavdwivedi5192 6 ปีที่แล้ว +7

    I am really grateful to you that you created this video because no one else on TH-cam has told the solution to this exception and also the method told by you is the most easiest. I want to tell you that this was the only exception in selenium which I did not knew how to handle and today you solved my only issue in selenium.
    Thank you sir.

  • @rajiniyalamarthy4480
    @rajiniyalamarthy4480 5 ปีที่แล้ว +6

    Very nice explanation,thank you!! I have watched many videos on youtube and read many blogs on StaleElementException, everyone has explained what does it mean but no one has explained how to handle it.This is the only video which made all my doubts clear about StaleElementException.Thanks so much for explaining along with practical example.

  • @meghasandesam
    @meghasandesam 5 ปีที่แล้ว +3

    without this there is no selenium interview, unfortunately i dint answer this question and lost my interview. now i understood in very easy format. tq verymuch sir

  • @divekshekhar633
    @divekshekhar633 ปีที่แล้ว +2

    Tommorow is my mini project evaluation in cognizant and I'm watching your videos.
    Thank you so much for this video

  • @bhupendrakushwaha1239
    @bhupendrakushwaha1239 11 หลายเดือนก่อน +1

    Thank you very much for uploading this video. It has helped me solved me the exception in the my test script.

    • @sdetpavan
      @sdetpavan  11 หลายเดือนก่อน

      You are welcome!

  • @suhasiniguthi5997
    @suhasiniguthi5997 ปีที่แล้ว

    Crystal clear explanation sir.

    • @sdetpavan
      @sdetpavan  ปีที่แล้ว

      Glad to hear that

  • @dharaneshbr2064
    @dharaneshbr2064 5 ปีที่แล้ว +1

    Thank you Sir giving Simple solution to handle StaleElementReferenceException!!

  • @rishikeshkshatriya9868
    @rishikeshkshatriya9868 5 ปีที่แล้ว

    Thank you so much, your idea helped fix the issue. The most easiest and straightforward fix. All other videos I watched did not make sense to me and were not of much help. maybe they are too smart or I am too low to understand what the intention was. either way, thank you again.

  • @urmilagargate1974
    @urmilagargate1974 2 ปีที่แล้ว +1

    Very nice solution u given sir for this problem in simple code... 👍🏻

  • @meeramusle2622
    @meeramusle2622 ปีที่แล้ว +1

    You are very great sir...

  • @mohammedshakir9636
    @mohammedshakir9636 2 หลายเดือนก่อน +1

    This worked, thank you so much !!!

    • @sdetpavan
      @sdetpavan  2 หลายเดือนก่อน

      Glad it helped!

  • @petrosbelachew3814
    @petrosbelachew3814 2 ปีที่แล้ว +1

    Thank you again. You are really helping us a lot.

    • @sdetpavan
      @sdetpavan  2 ปีที่แล้ว

      My pleasure!

  • @shannajsultana4518
    @shannajsultana4518 2 ปีที่แล้ว +1

    I like your explanation, excellent

  • @Mahidhembre
    @Mahidhembre 2 ปีที่แล้ว +1

    Very nice explaination Sir 👍🏾

  • @sppedysworld9323
    @sppedysworld9323 ปีที่แล้ว +1

    Thank you so much for ur efforts sir🙏

    • @sdetpavan
      @sdetpavan  ปีที่แล้ว +1

      It's my pleasure

  • @richajain2449
    @richajain2449 3 ปีที่แล้ว +1

    Nice explanation 👍👍

  • @donatesmile202
    @donatesmile202 6 ปีที่แล้ว +2

    Great Explanation. Thanks:)

  • @princeharsha3451
    @princeharsha3451 5 ปีที่แล้ว +1

    Awesome Explanation Sir.... :)

  • @rajneeshhiet
    @rajneeshhiet 5 ปีที่แล้ว +1

    Very nice explanation.....

  • @rrkolhapure3144
    @rrkolhapure3144 2 ปีที่แล้ว

    Nice One and Thank u for this video

  • @avikroychoudhury3858
    @avikroychoudhury3858 4 ปีที่แล้ว

    Thanks Sir for the solution, RIP to StaleElementReferenceException

  • @hellosasmitasgreenworld1896
    @hellosasmitasgreenworld1896 5 ปีที่แล้ว +1

    Thank you sir. Its really helped me lot.

  • @samratjulme8418
    @samratjulme8418 2 ปีที่แล้ว +1

    thank u so much sir........

    • @sdetpavan
      @sdetpavan  2 ปีที่แล้ว

      Most welcome

  • @mayanknandurkar3722
    @mayanknandurkar3722 4 ปีที่แล้ว +1

    Very Nice.😎.... Plz provide that website link🤟

  • @roopadolli1910
    @roopadolli1910 5 ปีที่แล้ว +1

    Nice sir,..

  • @sivarajan528
    @sivarajan528 11 หลายเดือนก่อน

    What if we have a sequence of scripts that all throw this exception.how we can handle those kind of things

  • @rawindragurchal371
    @rawindragurchal371 2 ปีที่แล้ว +1

    thank you sir

    • @sdetpavan
      @sdetpavan  2 ปีที่แล้ว

      Most welcome

  • @ranguvenkatesh7398
    @ranguvenkatesh7398 3 ปีที่แล้ว

    Can we handle through POM Frame work?, by using syntax : @findelement(locatername =''locatervalue');
    Plz clarify me about it.

  • @sanaaasif522
    @sanaaasif522 5 ปีที่แล้ว +2

    Thank you

  • @sarathchandra8331
    @sarathchandra8331 6 ปีที่แล้ว +1

    Thank you !!!

  • @naaz7847
    @naaz7847 2 ปีที่แล้ว

    sir by page factory how can we handle it?

  • @jyothijoy2018
    @jyothijoy2018 3 ปีที่แล้ว

    Sir I m trying to automate make my trip site city drop-down but I m not able to automate sir.. I m getting stale exception... Will u plz send me code regarding it

  • @sandeepambati563
    @sandeepambati563 4 ปีที่แล้ว +1

    How can we use try catch solution in loop for the below code?
    Please explain
    List footer = driver.findElements(By.xpath("//*[@id='pageFooterChildren']/ul/li"));
    int size = footer.size();
    for(int i = 0;i

  • @youtubecritic6898
    @youtubecritic6898 4 ปีที่แล้ว

    it generates stale reference error after 30 min.WHy?

  • @KatRollo
    @KatRollo 5 ปีที่แล้ว +1

    Main reason why a lot of test automation suites are peppered with try-catch blocks with repetitive code.
    Try looking into ExpectedConditions.refresh() instead.
    stackoverflow.com/questions/28026845/how-and-when-to-implement-refreshedexpectedconditiont-condition-of-selenium
    Or better yet, use lamba expressions.

  • @chennakesav7134
    @chennakesav7134 4 ปีที่แล้ว

    I understand the workaround for the stale exception. But In mycase, we are using page objects so xpaths are assigned to a variable and we will be using that variable in multiple test cases.
    do you have any suggestion to me to handle this exception?

    • @girishkondaparthy
      @girishkondaparthy 3 ปีที่แล้ว

      same problem with me.. i couldnt get to fix this issue with a locator using variable.