How To Click In Selenium WebDriver Using JavaScriptExecutor

  Рет қаралды 29,429

Mukesh otwani

Mukesh otwani

Күн бұрын

In this video, I will explain to you how to perform click events in Selenium using JavaScriptExecutor.
Many times while dealing with web element you will often get element intercepted exception which can be solved easily with JavaScriptExecutor.
Important link
www.selenium.d...
learn-automatio...

Пікірлер: 79
@kunal_chand
@kunal_chand 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 3 жыл бұрын
Great Kunal and I am glad it helped 😊🙏
@monicagoyal8225
@monicagoyal8225 3 жыл бұрын
Nothing can be as precise and clear as this video .Thanks.
@Mukeshotwani
@Mukeshotwani 2 жыл бұрын
Thanks Monica ji
@anilkumaryadav106
@anilkumaryadav106 4 жыл бұрын
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 4 жыл бұрын
Outstanding work really appreciatable work. Precisely you devoted your precious time to make this video.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thanks Sajab.
@sarikarani3165
@sarikarani3165 3 жыл бұрын
Thank you for explaining it in so simple way 🤩
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
thank you Sarika 😊
@mzamomahaeng268
@mzamomahaeng268 3 жыл бұрын
excellent explanation and masterclass 👏 👌
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thank you so much buddy.
@mandheermaan
@mandheermaan 3 жыл бұрын
Very Nicely Explained !!!
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Glad it was helpful! Thank you Mandheer
@mdhossain529
@mdhossain529 4 жыл бұрын
Thank you Sir, Its Awesome presentation.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thanks and welcome Hossain.
@swamyas5668
@swamyas5668 4 жыл бұрын
Super Master, thanks for sharing this video
@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?
@ZabTeam
@ZabTeam 4 жыл бұрын
Thank you a lot. Finally, I have made it works!
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Awesome Mate, I m glad it worked.
@jayanth787
@jayanth787 4 жыл бұрын
Thank you so much. Really helped me👍🙏👌
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hey Jayanth, I am Glad it helped!
@cjld104
@cjld104 3 жыл бұрын
**Uses JavaScript click** **It was super effective.**
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thank you Charles
@cutekunsh1883
@cutekunsh1883 3 жыл бұрын
Very Helpful , Thank you so much :)
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thanks Khusbhu I am glad it worked for you.
@arnavtyagi3
@arnavtyagi3 4 жыл бұрын
Thanks Mukesh, It really helped.
@akshayshinde7377
@akshayshinde7377 2 жыл бұрын
Very helpful......Thank you Sir
@Mukeshotwani
@Mukeshotwani 2 жыл бұрын
Thanks Akshay, I am glad it helped.
@nilakshipattanayak666
@nilakshipattanayak666 3 жыл бұрын
Thank you so much, this helped a lot
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thank you Nilakshi, I am glad it helped 🙏
@lijiprathapan8143
@lijiprathapan8143 4 жыл бұрын
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 4 жыл бұрын
Hi Liji, you can use findElements method which will return elements as list and the you can sort them using Collections class.
@lijiprathapan8143
@lijiprathapan8143 4 жыл бұрын
@@Mukeshotwani when I use findelements I can’t give the xpath or any locators
@neetigoyal9075
@neetigoyal9075 4 жыл бұрын
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.
@rakeshkumarpanda1693
@rakeshkumarpanda1693 4 жыл бұрын
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 жыл бұрын
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.
@vamsimalla7158
@vamsimalla7158 4 жыл бұрын
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 4 жыл бұрын
Hi Vamsi you can use Actions class so first call moveToElement then call click method of actions class.
@eg8580
@eg8580 4 жыл бұрын
Super helpful, thank you!
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
You're welcome!
@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?
@chinmayk2657
@chinmayk2657 3 жыл бұрын
Hi I need help, nainitalbank >>recruitment>>apply management trainee apply>> but click on new registration button not navigating/clickable
@NIRMALKUMAR-xo5kh
@NIRMALKUMAR-xo5kh 3 жыл бұрын
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
@bagzhansadvakassov1093
@bagzhansadvakassov1093 3 жыл бұрын
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.
@shakib2012
@shakib2012 7 ай бұрын
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 7 ай бұрын
It should be arguments[0].click();
@nikhilbhanvadiya1933
@nikhilbhanvadiya1933 4 жыл бұрын
hii Mukesh how click on Starts ?? for example how want to give reviews of products using starts *****
@miketysonschwarzeneggerpra9215
@miketysonschwarzeneggerpra9215 4 жыл бұрын
thanks, very good .you can make a videos using the most complete Google console. Enable the caption option, please ..
@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..
@rahulsachdeva9404
@rahulsachdeva9404 4 жыл бұрын
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
@chakrabmonoj
@chakrabmonoj 4 жыл бұрын
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
@khateraibrahimi6205
@khateraibrahimi6205 4 жыл бұрын
Thank you
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
You're welcome Khatera
@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 жыл бұрын
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 жыл бұрын
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 4 жыл бұрын
How to do this in VBA? Anyone can help?
@ilayarajaramasamy1263
@ilayarajaramasamy1263 3 жыл бұрын
6:00
@mihaiviteazu7296
@mihaiviteazu7296 2 жыл бұрын
Unfortunately not working in my case.
@Qurbatein03
@Qurbatein03 3 жыл бұрын
there was no need of music in this vedio.
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Yes agree ☺️
@HowTo-lc2rp
@HowTo-lc2rp 3 жыл бұрын
Please eliminate the background music from the videos , doesn't help to concentrate on what you are teaching.
How to Scroll In Selenium Webdriver using Java Script
5:46
Mukesh otwani
Рет қаралды 87 М.
How to execute failed test cases in Selenium webdriver
17:09
Mukesh otwani
Рет қаралды 97 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Selenium WebDriver Tutorial#37 - What is JavaScriptExecutor in Selenium
20:45
Software Testing Mentor
Рет қаралды 24 М.
How To Perform Drag and Drop in Selenium WebDriver
19:06
Mukesh otwani
Рет қаралды 30 М.
Highlight elements using JavaScriptExecutor - Selenium WebDriver Session 11
20:06
Enter Text into a Textbox using JavascriptExecutor in Selenium WebDriver
17:11
How to handle hidden webelements in Selenium Webdriver
21:19
Mukesh otwani
Рет қаралды 126 М.
Perform Click Operation using JavascriptExecutor in Selenium WebDriver
22:17
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН