How To Handle No Such Element Exception - Selenium WebDriver Tutorial

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ • 92

  • @anasibrahim6548
    @anasibrahim6548 3 роки тому +1

    i was working on a bot for my company and this tutorial savedddd meeee
    Thank sir
    continueeeee

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @abhishekpal3809
    @abhishekpal3809 2 роки тому +1

    Thanks Bhai for this video , 4 hours se laga hua tha smj nahi aa rha tha element kyo nahi mil rha , then I got the answer - my element was in ''

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +2

      Hahaha, thanks bhai for such a beautiful comment. Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @shmidt_rc2338
    @shmidt_rc2338 2 роки тому +1

    thank you!!! I lost 4 hours to find out the problem and the only you helped me!)
    my solution was switchTo()frame

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @venkateshchowdary4331
    @venkateshchowdary4331 3 роки тому +1

    your voice modulation and explanation is good sir...

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @AliAkbar-pm4ry
    @AliAkbar-pm4ry 2 роки тому +1

    Thanks God Finally i got my solution after 4 days of searching ! Thank you!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @saravanansaravanan18
    @saravanansaravanan18 2 роки тому +1

    You are best in fixing issues

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +2

      Glad you found it helpful, please like and share the video to spread the word :)

  • @coryho9124
    @coryho9124 3 роки тому +1

    What if the has no id or name. I only could find the src, but there was no name or id

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      If doesn't have id or name, we can find the with the help of index also.

  • @nishakanchan7682
    @nishakanchan7682 4 роки тому +1

    Hi.. How do i locate an element (linked text). I get no such elementexception but my linked text is something like this: Sign in
    On trying to locate by linkedtext "Sign In" i get a Nosuchelementexception. Please help

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +1

      What code you are using?
      Better try with XPath.

    • @nishakanchan7682
      @nishakanchan7682 4 роки тому +1

      @@LetsKodeItOfficial thank you. I got the issue.. I used sign in to build xpath and that was not right. It was fixed after I used javascript:; to build xpath.
      Thank you for ur quick response.
      Your videos r very nice, informative and precise!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +2

      @@nishakanchan7682 Glad you liked the videos. If you like, you can enroll in our complete course. You will have lifetime access and you will get all the test automation courses in one bundle:
      courses.letskodeit.com/courses/test-automation-bundle?coupon=UA-camRS29

  • @muhammadnabeel1375
    @muhammadnabeel1375 5 років тому +3

    hii..
    when i use implicit wait line the issue stills occurs so what can i do.....???

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  5 років тому +1

      There could be other issues as explained in the video. Timing issues is only one of the reason. In timing issue also, it may be possible that you can get the exception. At that time, you will have to use Explicit Wait

  • @alanlevy1986
    @alanlevy1986 3 роки тому +1

    thanks for the video!
    can you show how to handle a "no such element: Unable to locate element" solution in C#. i have a product page that i need to crawl. but some elements are with empty text and on other products are with value. but when i get to a one without text i get an Exception and the its not continuing to locate the other elements.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      The concept doesn't change with programming language. It will still be same reasons. You can send me the code at letskodeit@gmail.com and I can take a look. Please convert your code to Java or Python. I don't work with C Sharp.

  • @lovesnhugs
    @lovesnhugs 2 роки тому +1

    Can you show an example where there is a parent, then a li below the parent, then another sublevel below that that is the 7th of type (7the child of the 2nd level). It is not in an ... No unique name, id or tag.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      If you can provide an example website/element, I can definitely help you find the element.

  • @karthikeyanb6897
    @karthikeyanb6897 2 роки тому +1

    very clear Explanation..!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @satylearn3383
    @satylearn3383 2 роки тому +1

    Excellent solution. Thank you

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @divyabharathi2128
    @divyabharathi2128 6 років тому +2

    Superb... Thank you so much.. clear explanations. Understood very well..

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  6 років тому +1

      Glad you liked it :) Please feel free to share this video with your friends. It really helps us to bring more videos like this.

  • @sowmyadevamanohar9192
    @sowmyadevamanohar9192 5 років тому +2

    Thanks! I have used explicit wait but even after that I'm getting a timeout exception

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  5 років тому +1

      It is not feasible to figure out the issue without seeing your code and environment.
      If you like our content, you can enroll in the complete course also here, and we can help you with the issues you are seeing:
      courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899

    • @kylosimon373
      @kylosimon373 3 роки тому

      you probably dont give a shit but if you guys are stoned like me during the covid times you can watch pretty much all of the latest series on instaflixxer. Been streaming with my girlfriend lately :)

    • @codykyle7563
      @codykyle7563 3 роки тому

      @Kylo Simon Definitely, have been using InstaFlixxer for since december myself :D

  • @ЛенаГоловач-ъ2г
    @ЛенаГоловач-ъ2г 2 роки тому +1

    Liked and subscribed!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful, please share the video to spread the word :)

  • @thennarasuthen9179
    @thennarasuthen9179 3 роки тому +1

    very helpful.. saved my day...thank you

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +2

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @JhonniMartins
    @JhonniMartins 3 роки тому +1

    Thank you, helped a lot about the iFrame

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.
      If you like our content, you can enroll in the complete course also here:
      courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899

  • @ramphalke5775
    @ramphalke5775 5 років тому +1

    org.openqa.selenium.ElementNotVisibleException: element not interactable
    I am still getting error :(

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  5 років тому

      ElementNotInteractable is a different kind of exception, it is not as same as NoSuchElementException.
      ElementNotVisible is also a different kind of exception.
      ElementNotInteractable is similar to this kind of exception, but may not be same in every scenario:
      ua-cam.com/video/iaI1vcEAWlM/v-deo.html

  • @shanvazshaik9654
    @shanvazshaik9654 2 роки тому +1

    thanks a lot 😃

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @alexroy9486
    @alexroy9486 4 роки тому +1

    Personally my worst timing issue is when selenium thinks he clicked on an element when in reality he didin't. I think It's mainly because I'm telling selenium to click on some text with xpath when the text is present but the button functionality where the text belong to isint active yet skipping that line pretty much and trying to execute the next one. I had no found any solution for this one other than doing time.sleep(1) which I hate doing lol.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +2

      You should try Explicit Wait and expected condition wait for element to become clickable.

  • @AjayKumar-ky8vo
    @AjayKumar-ky8vo 2 роки тому +1

    Thank you my problem got solved 🙌

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

  • @bojanjovic1404
    @bojanjovic1404 6 років тому +1

    Hi,
    I had a problem with Momondo website. I posted problem on your google group.
    What I find out for this website is that there are multiple elements (more than one matching nodes) with the same XPATH.
    So when I selected precisely one element (one matching node) than it didn't work, but when I leave xpath to find for example 2 elements (two matching nodes) and put it into the code than it worked.
    I really don't know how this works and why it works on this way.
    This totally confusing me.
    Can you investigate and find out why it works just on this totally unexpected way and why does not work when you precisely specify XPATH?
    Here is the link about problem in your google group:
    groups.google.com/forum/#!topic/letskodeselenium/YsHFJXPkUD0

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +1

      Please ask problems related to the video here.
      For other topics, please post a question on google group and will reply there.

  • @andukurirahulratan2256
    @andukurirahulratan2256 3 роки тому +1

    Worked for me thxs a lot

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.
      If you like our content, you can enroll in the complete course also here:
      courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899

  • @alamar11
    @alamar11 3 роки тому +1

    Thank you SO much

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you liked it :)
      Please feel free to share this video with your friends. It really helps us to bring more videos like this.

  • @narasimha4962
    @narasimha4962 6 років тому +1

    Super Explanation,Thank you

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @AC-vt1nq
    @AC-vt1nq 3 роки тому +1

    Thanks , it was very informative.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.
      If you like our content, you can enroll in the complete course also here:
      learn.letskodeit.com/p/selenium-webdriver-with-java/?product_id=342636&coupon_code=UA-camSELJAVA9

    • @vishveshkhandpur2560
      @vishveshkhandpur2560 3 роки тому +1

      @@LetsKodeItOfficial Hello can you please help, I am trying to interact with the buy now button on the amazon page. But, I am getting the error: str object is not callable. I have written the below lines of code.
      context=driver.find_element(By.XPATH("//button[contains(@class,'_2KpZ6l _2U9uOA _3v1-ww')]"))
      context.click()
      Will be very glad if you can please help me out. Thanks!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +2

      @@vishveshkhandpur2560 Please send your complete code at letskodeit@gmail.com and will be happy to help.

    • @vishveshkhandpur2560
      @vishveshkhandpur2560 3 роки тому +1

      @@LetsKodeItOfficial Thanks a lot, for the response I have mailed it!

  • @samruddhashirude8348
    @samruddhashirude8348 6 років тому +1

    NoSuchElement found and notvisibile exception are sane?

    • @samruddhashirude8348
      @samruddhashirude8348 6 років тому

      NoSuchElement found and not visible exception are Same?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  6 років тому

      They are not same. If element is present but it is not visible on the screen then ElementNotVisible Exception show up

  • @Letsnavigatetheunknown
    @Letsnavigatetheunknown 4 роки тому +1

    Thanks man its worked

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +2

      Glad it helped you :)
      Please help spread the word by liking and sharing the video.

    • @Letsnavigatetheunknown
      @Letsnavigatetheunknown 4 роки тому +1

      @@LetsKodeItOfficial please upload complete selenium course because your teaching style is awesome.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +1

      @@Letsnavigatetheunknown It's available here. Please enroll if you like:
      courses.letskodeit.com/courses/selenium-webdriver-with-java?coupon=UA-camRS899

  • @dikanurhasanah3218
    @dikanurhasanah3218 5 років тому +1

    thank you, this is really helpfull!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  5 років тому

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.
      If you like our content, you can enroll in the complete course also here:
      learn.letskodeit.com/p/selenium-webdriver-with-java/?product_id=342636&coupon_code=UA-camSELJAVA9

  • @poojad6164
    @poojad6164 3 роки тому +1

    Thanks for such a informative video.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @yoriedwardville1727
    @yoriedwardville1727 4 роки тому

    Just do ‘import time’ on the top -> then > ‘time.sleep(3)’ wherever you want the program to pause and wait until elements load

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому

      This is not a good way because of the uncertainty of the time an element can take to show up.

  • @alexroy9486
    @alexroy9486 4 роки тому +1

    Usually solved by 1 simple line |driver.implicitly_wait(30)| most no such element will be searched for 30 second before giving the exception, if it still does that this solution works well :)

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +1

      Implicit Wait does not work for all the scenarios, it does work for few scenarios though.

  • @Arun_Kumar_x86
    @Arun_Kumar_x86 4 роки тому +1

    i was using sleep(3) so it wait 3 sec . yes i am a genius :)

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +2

      You should not use that :)
      Please start using Implicit Wait and Explicit Wait.

    • @Arun_Kumar_x86
      @Arun_Kumar_x86 4 роки тому +1

      @@LetsKodeItOfficial OK I will do that

  • @prakashs636
    @prakashs636 5 років тому +1

    spr ji :)

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @ЛенаГоловач-ъ2г
    @ЛенаГоловач-ъ2г 2 роки тому +1

    Liked and subscribed!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful, please share the video to spread the word :)

  • @xushengchin511
    @xushengchin511 2 роки тому +1

    thank you so mcuh

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +2

      Glad you liked it :)
      Please feel free to share this video with your friends.

  • @numaellimasrodriguez6629
    @numaellimasrodriguez6629 2 роки тому

    thank you so much

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @ЛенаГоловач-ъ2г
    @ЛенаГоловач-ъ2г 2 роки тому +1

    Liked and subscribed!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful, please share the video to spread the word :)