Execute Javascript using Selenium Python - Part 13

preview_player
Показать описание
In this video, I have explained how to execute javascript code using selenium python.

It may so happen in some real time projects, Selenium WebDriver is not able to perform some action on a particular web element and interacting with web elements through Javascript was the only possible solution.

~~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Paid courses (Recorded) videos:
Рекомендации по теме
Комментарии
Автор

Very well explained, Helpful..Thank you

muzammilsayyed
Автор

Excellent job done by Naveen Sir, the master of Automation

MDHOSSAIN-gjve
Автор

hi, this video was greatly helpful. but is there a way to click on a video and scroll through the video using execute_script? or something in selenium?

johndoe-lzfo
Автор

Naveen it was working for me if I am using print and putting the driver part in it

crickettales
Автор

Hello Naveen!
Thanks a lot for your job.
Will you explain on moving to the top of the page - why did you put window height on x-coordinate? I belive that (0, 0) coordinates will work. Am I wrong here?

АлександрНохрин-щв
Автор

Hey Naveen, is this also an important topic in JS executor- executeAsyncScript?

BobuAchu
Автор

Hi Naveen,
The sendKeys with JavaScriptExecutor is working as below. I have tried the same on the hubspot application.
username=driver.find_element(By.ID, 'username')
driver.execute_script("arguments[0].value='amol.nawale';", username)

amolnawale
Автор

Hi Naveen,
Thank you for the tutorials, getting to learn a lot from these.
Can you please add a tutorial to handle date picker/calendar as it is a very important use case these days?

chakradharreddy
Автор

Hi Naveen. Can you please demo how to handle a calendar using with the help of selenium and Javascript using Python?

Awaiting your response.
Thanks in advance!

Barry_junglebeats
Автор

Hi Naveen How click on ag-grid table can you please explain

manjunathbandri
Автор

Hi Naveen
Please make videos on nightwatch as well.🙏
Thank you in advance 😊

shikhakajal
Автор

Hello Naveen,
Thanks for explaining the JS method.
I tried it on the same application for send value to the textbox.
email = driver.find_element(By.ID, 'username')
driver.execute_script("document.getElementById('username').value='rahul_pawar', email;")

rahulpawar
Автор

Do you know why scrollTo is not working in browser console and python. I tested in browser with different data window.scrollTo(0, 800); and changed the 800 to other number and still it did nothing. Python not scrolling as well. Tested in chrome

armandcompar
Автор

some sites says access denied when refresh by history.go(0) also some scripts don't work. Any solution for that?

gauravsharmalucknow
Автор

now the command to scroll down a yourtube page is:
driver.execute_script("window.scrollTo(0,

rishabhjoshi
Автор

Hi Naveen, I can't able to join ur telegram group...

yesjay
Автор

Can anyone suggest how to input text/value using javascript in Robot framework?
I have tried this, but not working.
Execute Javascript arguments[0].value='123'; xpath

jennhankcock