How To Click In Selenium WebDriver Using JavaScriptExecutor

Поділитися
Вставка
  • Опубліковано 3 лис 2024

КОМЕНТАРІ • 79

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

    I spent hours looking for a solution to "Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: element not interactable" error.
    Thank you so much. Your trick works perfectly. This video deserves a like.

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

      Great Kunal and I am glad it helped 😊🙏

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

    Nothing can be as precise and clear as this video .Thanks.

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

    Finally I got to know why we use this, thanks.

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

      Great Anil, next video will give more clarity about JavaScriptExeutor

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

    Outstanding work really appreciatable work. Precisely you devoted your precious time to make this video.

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

    Thank you for explaining it in so simple way 🤩

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

    excellent explanation and masterclass 👏 👌

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

    Hi Mukesh, Can we write on text box with java script executer. In my project I have Pega model Window and it can not intractable. When run code it always says NoSuchElemnt.Or can you advice how to do automation for Pega Model Window?

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

    Very Nicely Explained !!!

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

      Glad it was helpful! Thank you Mandheer

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

    Thank you Sir, Its Awesome presentation.

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

    hii Mukesh how click on Starts ?? for example how want to give reviews of products using starts *****

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

    Super Master, thanks for sharing this video

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

    **Uses JavaScript click**
    **It was super effective.**

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

    Hi Mukesh; if I can’t click on a particular element to get the locator ;how can I print all elements on console ;based on sorted one(only the price)?

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

      Hi Liji, you can use findElements method which will return elements as list and the you can sort them using Collections class.

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

      @@Mukeshotwani when I use findelements I can’t give the xpath or any locators

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

    Hi Mukesh,
    Just a small query here why specifically we are mentioning arguments [0] why not arguments [1] or any other number or simply as argument...just wanted to know the significance of arguments [0]. Plz share ur inputs

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

      Valid question Rakesh, next video which is coming tomorrow will clear your argument doubt.

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

      @@Mukeshotwani Great effort Mukesh...Thanx a lot for taking my question in consideration. It's my great pleasure.

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

    awesome as always.
    Just one suggestion , kindly don't zoom it and zoom out unless it is really required.It distract the focus and really not very eyes friendly to quickly keep on changing the font and everything.

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

      Noted Neeti thanks for suggestions. I found zoom in zoom out make video more attractive because we can focus on minor details as well.

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

      @@Mukeshotwani yes Agreed , but actually when we are already watching your videos in full screen , then it is really not required untill the font is very small. But you already take care of font thing for your viewers to make it pretty readable.

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

    I wonder if Selenium Actions are better or have same effect?

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

      Hi Bagzhan, Selenium actions works 95% of time so I only used JS actions whenever Selenium fail to perform on elements.

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

    hi sir, after doing mouseover in amazon application , I need to click on orders without using link text . could you please help me with the same.

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

      Hi Vamsi you can use Actions class so first call moveToElement then call click method of actions class.

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

    Thanks Mukesh, It really helped.

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

    Very helpful......Thank you Sir

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

      Thanks Akshay, I am glad it helped.

  • @NIRMALKUMAR-xo5kh
    @NIRMALKUMAR-xo5kh 2 роки тому

    Hi Mukesh can you please tell me how to do double click using js executor. I have tried dblclick function but it's not working for me

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

    Thank you so much. Really helped me👍🙏👌

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

    Thank you a lot. Finally, I have made it works!

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

    Hi I need help, nainitalbank >>recruitment>>apply management trainee apply>> but click on new registration button not navigating/clickable

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

    Thank you so much, this helped a lot

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

      Thank you Nilakshi, I am glad it helped 🙏

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

    Very Helpful , Thank you so much :)

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

      Thanks Khusbhu I am glad it worked for you.

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

    Hey Mukesh - loved this one like the other ones in your very instructive playlists. These are a joy to watch. I am facing a strange issue while trying to run a javascript with selenium (this error does not happen when I am using pureplay selenium commands and the program gets executed). Here's a snippet of the code :
    code :
    []ClicktoLO = browser.find_element(By.XPATH,"//div[@id]/button[starts-with(@class, 'global-nav__primary-link artdeco-dropdown')]")
    []browser.execute_script("arguments[0].click();", ClicktoLO)
    But if I change the above code to simply ClickLO.click(), then the code performs as intended without any error.
    I have downloaded the chrome driver compatible with my version of chrome.
    Would you be able to help with a workaround?
    note : I am using Chrome version starting with 88 and the site I am using is @t, if that helps

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

    thanks, very good .you can make a videos using the most complete Google console.
    Enable the caption option, please ..

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

    hello sir i am try this that is documnet.title on you tube but it gives error to me. i try all different options but it does not click on it why?

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

    Hi Mukesh... Now Javascriptexecutor is clear to me... But i am still facing to access this element via javascriptexecutor...
    could you please me... how i can access :: before line??
    ::before
    ::after

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

    Super helpful, thank you!

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

    Thank you

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

    Hi! I have a scenario on the web page when I enter the password with mouse (clicking for each digit). Have you worked a scenario like the one I mention? on my side I was capturing each value to make comparisons but it brings me null. Greetings from Peru 🇵🇪

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

      Hey Abraham, if you can share the sample application then I can help you here.

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

      @@Mukeshotwani I solved it, yesterday. Thanks my friend. God Bless U

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

      @@mrpimpita5555 Thanks a ton mate..

  • @shakib2012
    @shakib2012 4 місяці тому

    Hi, I am getting this error when using executeScript method - org.openqa.selenium.JavascriptException: javascript error: arguments[0].click is not a function. Is there any solution for this, I have checked the syntax it is correct.

    • @Mukeshotwani
      @Mukeshotwani  4 місяці тому

      It should be arguments[0].click();

  • @RajeshKumar-sz1ci
    @RajeshKumar-sz1ci 4 роки тому

    Hi sir... Can you help me how to fix this error. javascript error: Cannot read property 'clientWidth' of null

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

      Hey Rajesh, can you share full log along with screenshot ? My email is mukeshotwani@learn-automation.com

    • @RajeshKumar-sz1ci
      @RajeshKumar-sz1ci 4 роки тому

      @@Mukeshotwani Sir i just sent you an email with full Log.

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

    How to do double click with js executor

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

      Hi Mohan you can use dblclick() function

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

      @@Mukeshotwani thanks mukesh for the quick reply. I tried that already and it didn’t work. My case is to double click radio button in safari browser. In all other browsers single click is working and there is a bug with safari browser/ driver and solution is to do double click .

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

    Thanks a lot

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

    How to handle I am not robot checkbox

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

      Hi Mayuri, if after selecting checkbox if it is showing some images like select lights etc in that case you cant automate.

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

    How to do this in VBA? Anyone can help?

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

    Unfortunately not working in my case.

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

    there was no need of music in this vedio.

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

    6:00

  • @HowTo-lc2rp
    @HowTo-lc2rp 3 роки тому

    Please eliminate the background music from the videos , doesn't help to concentrate on what you are teaching.