How To Execute Selenium Scripts On Already Opened Browser

Ғылым және технология

In this video, I will share how to execute selenium test or script on already opened browser using Chrome DevTools Protocol.
Here the blog link along with code
learn-automation.com/how-to-ex...
Chrome Devtools
chromedevtools.github.io/devt...
All Videos
/ mukeshotwani
All Playlist
/ mukeshotwani
Connect with us:
Linkedin- / mukesh-otwani-93631b99
Instagram- / mukeshotwani
Facebook Group- / 256655817858291
Facebook Page- / seleniumwebdrivermukesh
Twitter- / mukeshotwani
Blog- learn-automation.com

Пікірлер: 164

  • @sanghamitrabhowmicklive3013
    @sanghamitrabhowmicklive30132 жыл бұрын

    This is amazing information. I really donno how should we thank you for all the knowledge you have been sharing with us. Hats off to you!!!!!

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    Thank you so much 🙏 Sanghamitra

  • @prathameshlad6565
    @prathameshlad6565 Жыл бұрын

    The only video I found helpful for this topic. I Spend 3 days searching for relevant information and finally found it. Thank you very much.

  • @SameerKumar-yu1xi
    @SameerKumar-yu1xi3 жыл бұрын

    Day end with something new... Worth 21 min of the day👍🏻 thx sir

  • @Hydharg
    @Hydharg3 жыл бұрын

    Thanks for the session Mukesh! You are doing very useful works. Keep it up. Well done!!!

  • @vijaykumar-ut1ze
    @vijaykumar-ut1ze3 жыл бұрын

    I have been waiting till now for this option..thanks mukesh for giving the session on this

  • @karthikeyaguptha
    @karthikeyaguptha Жыл бұрын

    Thanks for giving information on how to run scripts on existing chrome instance opened ...Helped me a lot

  • @MeixnerQuest
    @MeixnerQuest3 жыл бұрын

    I been looking for this information, great tutorial

  • @sreereshvkm726
    @sreereshvkm7263 жыл бұрын

    Loved it.. Expecting many more like this

  • @engineerraj1662
    @engineerraj16623 жыл бұрын

    Thank you so much for sharing this with us Mukesh 👍

  • @balagopalt4447
    @balagopalt44473 жыл бұрын

    Thanks a lot Mukesh for the video. Excellent video. Very much useful.

  • @sdetworld8997
    @sdetworld89973 жыл бұрын

    Very good info Mukesh. Thank you for the same. this is a painkiller.

  • @sumitsaha9782
    @sumitsaha97823 жыл бұрын

    Amazing feature. Thanks sir. This will be very handy for on-the-fly scripting and validation of the developed scripts :)

  • @TheyCallMeDin
    @TheyCallMeDin3 жыл бұрын

    Been wanting to find a way to do this for years! Thank you!!

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    Welcome mate I m glad it helped ☺️

  • @jagadeeshbedge8447
    @jagadeeshbedge84473 жыл бұрын

    Thank you Mukesh.. it saved me a lot of time in rework .

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    Glad it helped Jagadeesh

  • @SarangHoley
    @SarangHoley3 жыл бұрын

    Amazing topic covered Mukesh 👍

  • @saikrishna.b736
    @saikrishna.b7363 жыл бұрын

    Thanks for this interesting video... Thought of this but didnot search any time or tried checking for this...

  • @panchananbhattacharjee9512
    @panchananbhattacharjee95122 жыл бұрын

    This is so helpful, looking for this option long time. Thanks a lot for sharing. Thumbs Uppp

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    Thanks Panchanan, I am glad it helped you.

  • @shadowfrost420
    @shadowfrost4203 жыл бұрын

    Thank you for sharing , good information as always !

  • @mandeep3445
    @mandeep34453 жыл бұрын

    Thank you very much Mukesh!!!

  • @JitendraKumar-lr3vq
    @JitendraKumar-lr3vq2 жыл бұрын

    This was amazing concept to learn.. thanks a lot for explaining in such details..

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    Thank you Jitendra and welcome back too 😊

  • @tapaspadhi1530
    @tapaspadhi15303 жыл бұрын

    it helps Mukesh. Thanks for sharing

  • @swamyas5668
    @swamyas56683 жыл бұрын

    Thank you 🙏 for teaching new things 👌

  • @kunalshah332
    @kunalshah3323 жыл бұрын

    Great session ...very helpful✌

  • @praveenvanam6491
    @praveenvanam64913 жыл бұрын

    Thank you so much for this new topic

  • @hafezgharib7639
    @hafezgharib76392 жыл бұрын

    You gotta a new subscriber for this one :). Very helpful, I was looking for this the whole day ^^, thank you so much. Could you do the last part(the one you extracting the debuggerAddress) in python pls?

  • @surajgoenka
    @surajgoenka3 жыл бұрын

    I will execute last 2 steps manually lol jokesapart, thankyou for the video

  • @etemkeskin5025
    @etemkeskin50253 жыл бұрын

    you saved my lots of time. thanks

  • @mauryar16
    @mauryar163 жыл бұрын

    Thnx for this video..It made debugging in less time

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    Thanks Rajendra.

  • @adityapratapsingh3825
    @adityapratapsingh38253 жыл бұрын

    You r awesome brother..

  • @pallabipurohit1061
    @pallabipurohit10613 жыл бұрын

    Very informative

  • @sanjay4727
    @sanjay47273 жыл бұрын

    Very useful, Thanks for sharing this

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    Glad it was helpful! Sanjay

  • @sindhusudhakaran1731
    @sindhusudhakaran17313 жыл бұрын

    this is very useful .. thank you !!

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    You are welcome! Sindhu

  • @subisw
    @subisw2 жыл бұрын

    OH It's cool...Thank you!

  • @shankumondal2881
    @shankumondal28813 жыл бұрын

    Awesome 👍

  • @prestonkingsley375
    @prestonkingsley3753 жыл бұрын

    Thank u sir, learnt something new. Could you please show how to sort a webtable based on dates

  • @rkn3383
    @rkn33833 жыл бұрын

    Just awesome

  • @prikshitverma3885
    @prikshitverma38853 жыл бұрын

    Dhanyawad 🔥🔥

  • @pranjaliganorkar7731
    @pranjaliganorkar77313 жыл бұрын

    Hi Mukesh, your videos on Selenium are very helpful. I am working on Selenium with Typescript as the underlying language. This is a very different language considering from Java background. Would you be able to post some videos on Selenium with Typescript and Jest or other test runner framework? Thanks in advance.

  • @shubhamm1843
    @shubhamm18432 жыл бұрын

    that was a good one but i have different chrome profiles, how to executive a particular script on a particular profile

  • @KhalilYasser
    @KhalilYasser3 жыл бұрын

    Thank you very much. Can you make another same video for python?

  • @vinayakchavan7694
    @vinayakchavan76942 жыл бұрын

    Its awesome 😊 thank you...

  • @vinayakchavan7694

    @vinayakchavan7694

    2 жыл бұрын

    For Microsoft edge we can do same solution na???

  • @goldentertainment2335
    @goldentertainment23353 жыл бұрын

    Thank You So much sir,

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    Most welcome Mate

  • @smartpatel8093
    @smartpatel8093 Жыл бұрын

    Hello sir set experiment option is not Avelible in c# any idea ???

  • @chakrabmonoj
    @chakrabmonoj3 жыл бұрын

    Hi Mukesh - thanks for another great lesson. Very helpful. I had a question : will the same commands work with Python as well, or these can be used only with Java? Thanks

  • @adosdiagne8359
    @adosdiagne83592 жыл бұрын

    Thank you Mukesh.. it is very interesting. How can do this with webdriverio ?

  • @niyus56489
    @niyus564892 жыл бұрын

    This is really awesome.. Thank you....can we do the same for edge browser also..I tried it is showing some error..can u pls help

  • @aniketfarkase9759
    @aniketfarkase97593 жыл бұрын

    Excellent

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    Thank you so much 😀 Aniket

  • @hammadmaqsood6395
    @hammadmaqsood63952 жыл бұрын

    Hi, can you provide the same code for C# developers Good video.

  • @miketysonschwarzeneggerpra9215
    @miketysonschwarzeneggerpra92153 жыл бұрын

    Excellent video. Please activate subtitle in your videos.

  • @vinodkumaryadav1292
    @vinodkumaryadav1292 Жыл бұрын

    Thanks Mukesh.. It's very helpful... I am trying to do same with Edge driver but it's not letting me do.. Would you please help me with Edge browsers

  • @srujjhanaadevy3712
    @srujjhanaadevy3712 Жыл бұрын

    @Mukesh otwani is it possible to execute the command via java code itself rather than manually executing it on terminal

  • @dibakardey6097
    @dibakardey6097 Жыл бұрын

    Hi @Mukesh, suppose the testcase fails in particular step is it possible to run the script from the step it got failed in the same session

  • @warademilind
    @warademilind Жыл бұрын

    Is it possible to do with Electron based application (desktop based app- chromium)? I am able to launch and execute properly..but not sure how to go ahead with already opened app. Thanks

  • @namratasingh3464
    @namratasingh3464 Жыл бұрын

    Hi Mukesh, thanks your videos are really helpful! I have a query, in which when I am clicking on a button it is giving me one id, then have to wait overnight, and then next day login on the other URL where this id will have few account numbers and other data which I have to verfiy. but waiting overnight is must for data to generate , How this can be managed using Selenium ? Thanks!

  • @poornimamanjunath6205
    @poornimamanjunath62052 жыл бұрын

    Mukesh, Is is possible for you to please share the python code for the same? or any link? Also, what if I want to attach to a webpage using its title not the url? what is the selenium api for connecting to a web page using its title?

  • @monikasingh2295
    @monikasingh22952 жыл бұрын

    Hi Mukesh, How to use the same approach while executing the script in edge?

  • @darkevil9348
    @darkevil9348 Жыл бұрын

    I have a question is it compulsory to add driver.get() line.

  • @viplovebisen
    @viplovebisen3 жыл бұрын

    awesome

  • @srikanthvodnala2505
    @srikanthvodnala25052 жыл бұрын

    Hi great explanation I loved it I have one doubt we are connecting to the existing opened browser. If in one situation for example by selenium I log in to Facebook. after finishing my work I closed the existing browser to which selenium is connected. Then I have run the same selenium code I have to log in again or In that browser it already login. Doubt: After closing the browser how to open the existing browser in which all our login credentials and cookies are stored.

  • @BlackCherry11140
    @BlackCherry111402 жыл бұрын

    what if we want to use existing session where all extension and logged accounts are available instead of fresh new session just came to my mind if it is possible please share it as soon as possible....

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    You can reuse sessions which is started via CDP

  • @xitcode
    @xitcode Жыл бұрын

    thanks

  • @BennyJonesDG
    @BennyJonesDG2 ай бұрын

    is it possible to do this in the Edge browser??

  • @amiablekrishna
    @amiablekrishna Жыл бұрын

    Mukesh, Can you explain, how to continue with next scenario in case of a Failure any test in Selenium? i need to execute all scenario.

  • @angelus806
    @angelus8062 жыл бұрын

    what about an user session with extensions already installed? or a browser already running with a profile already working .. how can I drive that ?

  • @manickarajans6653
    @manickarajans66533 жыл бұрын

    How to turn off remote debugging in edge chromium through edge options.. requirement to test in IE mode

  • @travellover3934
    @travellover3934 Жыл бұрын

    Its possible to use screenshot function here?

  • @mahatheedandibhotla
    @mahatheedandibhotla3 жыл бұрын

    whats the use of creating chromedata folders

  • @Jerometk
    @Jerometk2 жыл бұрын

    How can I do this in firefox geckodriver?

  • @srajanshrivastava8391
    @srajanshrivastava8391 Жыл бұрын

    Hi, i am using grid implementation in my project, we are able to get running chrome session in local but when we change local host to the IP of other machine it say cannot connect to chrome::, Can you please help me on this

  • @venpraveen
    @venpraveen3 жыл бұрын

    Hi mukesh, my eclipse is not supporting the browser because of updates, which version is the best t o support browser windows 64 bit machine. Thanks in advance

  • @hamimalam4968
    @hamimalam49683 жыл бұрын

    I want to know what if we use two class and call the class in the main method. how do I do it. please make a video about it.. thanx

  • @MrBoingts
    @MrBoingts Жыл бұрын

    Hi, I followed and doubled checked all the steps, but when i hit enter ( +- 5:46) I open a browser BUT i'm still signed in - I have created this folder in my C driver - is that the issue ?

  • @shubhamjha5738
    @shubhamjha57383 жыл бұрын

    Sir if we put our website in production,hosting is done. Then what will happen, again we need to execute commands on terminal?

  • @Imran-M-
    @Imran-M-3 жыл бұрын

    Thanks Mukesh for making this video. I've tried to use TestNg instead of main() : @BeforeMethod (wrote "debuggerAddress" code in this block) @Test (driver.get(), sendKeys() here ) @AfterMethod (driver.quit() here)...................but for some reason code in @After is not recognized and not taken. Any idea?

  • @piyushmarda9720
    @piyushmarda97203 жыл бұрын

    This is very informative Mukesh. I never found a solution for this issue till date. I used to like UFT more than selenium for the same reason. Is there any solution for edge browser as well?

  • @Mukeshotwani

    @Mukeshotwani

    3 жыл бұрын

    yes same thing can be done for Edge too

  • @rajeshkumar-no8sp
    @rajeshkumar-no8sp Жыл бұрын

    Can we do this on mac?

  • @jatinqa4020
    @jatinqa402010 ай бұрын

    Thank you sir, I have 1 question that i am using chrome 117.0.5938.132 but chromedriver.exe is not working with this what to do

  • @madhiyazhagansm9659
    @madhiyazhagansm96593 жыл бұрын

    Hi Mukesh, can we execute Appium scripts on already opened app ?

  • @genghiskhan5685
    @genghiskhan56852 жыл бұрын

    You have a video using Python, and in this video you are using Java. You should specify that in the title so anyone looking for your similar videos can differentiate thanks.

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    For Python kzread.info/dash/bejne/jKasmqiMddKfnM4.html For Java kzread.info/dash/bejne/hKafzJatlLvUl7w.html

  • @sagaryenkar3988
    @sagaryenkar39882 жыл бұрын

    It's possible in headless mode

  • @alexdin1565
    @alexdin1565 Жыл бұрын

    can run selenium on cpanel?

  • @mohammadhoseinkarimi4721
    @mohammadhoseinkarimi47212 жыл бұрын

    hi! it still does not work for me and open the new chrome window. could you please help me I'm new but I really need it thanks!

  • @hdstudio1875
    @hdstudio18753 жыл бұрын

    Only problem is, if u open the task manager or try to kill existing drivers using task kill, u will be able to see that it's creating new driver everytime however the browser is same, as u r using 'new ChromeDriver(opt)' method. So am unable to find out how to use the existing instance of driver so that I can close it, coz every body may not have admin permission to use taskKill to kill drivers.

  • @kailaspoduval
    @kailaspoduval3 жыл бұрын

    Thanks a lot Mukhesh ji🙂..really useful one in day to day automation work..a Time saver while checking fixes. Could you pls let me know is this possible in Firefox browser??

  • @Akit87

    @Akit87

    3 жыл бұрын

    I am also looking for firefox, did you find any solution?

  • @sriramkasu5286

    @sriramkasu5286

    3 жыл бұрын

    @@Akit87 same me too

  • @Akit87

    @Akit87

    3 жыл бұрын

    @@sriramkasu5286 I tried various methods but none of them worked for me

  • @sriramkasu5286

    @sriramkasu5286

    3 жыл бұрын

    @@Akit87 same here...but I saw some forums and documenations mentioning --connect-existing flags and also --marionette flaga

  • @Akit87

    @Akit87

    3 жыл бұрын

    @@sriramkasu5286 same I also saw these options on some forum, but not sure how to use these

  • @akcandlestick8948
    @akcandlestick89482 жыл бұрын

    every time we type console command for this execute selenium ??

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    Once it is opened then you can use until you close manually.

  • @user-qn6jp3bw8n
    @user-qn6jp3bw8n4 ай бұрын

    Hi Mukesh, In chromedriver version 3.141.59 this func is not working

  • @juliebrennan-oit8409
    @juliebrennan-oit84092 жыл бұрын

    Hi the chrome session will open from the command line, but when I run from selenium script I get the following error: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot connect to chrome at localhost:8989 from chrome not reachable Can you help me?

  • @user-ky8lz4ol4m
    @user-ky8lz4ol4m2 жыл бұрын

    Hi Mukesh, Nice video! Thanks for creating it. I followed all the steps as shown in the video but still for me it is opening another browser rather than executing in the opened browser. Could you please help me to resolve the issue? Thanks, Swati

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    Hi Swati, please watch video again you might have missed some minor steps.

  • @user-ky8lz4ol4m

    @user-ky8lz4ol4m

    2 жыл бұрын

    I followed all the steps. I think Selenium is not recognizing the browser instance that I am opening manually. I don't know if while opening browser manually it opens on the port no which I am giving.

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    @@user-ky8lz4ol4m share ur code

  • @prasannaselva4525

    @prasannaselva4525

    2 жыл бұрын

    @@Mukeshotwani It's the same for me.. Please help me

  • @chromeuser7363
    @chromeuser7363 Жыл бұрын

    Anybody knows the command for linux that'll keep the browser window open at port 9222

  • @RanjitSingh-wp2sn
    @RanjitSingh-wp2snКүн бұрын

    ********** *VERY DIFFERENT SCENARIO* ********** Hi Muskesh, I have one scenario where i launch an exe file using dekstop based tools and then it opens up a browser for me to select my credentials (Azure Web SSO functionality) but it is opened by that application so i cannot open it in the debugging mode. Usually i can handle the chrome from desktop also in which i execute a jar file with the set of functions but here the challange is to interact with the chrome broswer which is opened by the functionality. Is there a way that i can interact with that chrome instance.... Many Thanks in advance.

  • @nirbhaydeeptrigunayat1767
    @nirbhaydeeptrigunayat17676 ай бұрын

    how to open "default" chrome browser using selenium with java and navigation url.

  • @rpfoodie799
    @rpfoodie7992 жыл бұрын

    Can Anyone here suggest some code for edge browser using VBA selenium

  • @nilesh123234
    @nilesh1232342 жыл бұрын

    Can we do the same on macbook ???

  • @nilesh123234

    @nilesh123234

    2 жыл бұрын

    I am not able to run second command in mac terminal

  • @Livespiritful
    @Livespiritful Жыл бұрын

    My Requirement is: Prerequisites: 1) Launch Google Chrome as "Run as Different User" (Right click of the Chrome icon) 2) Enter Windows user and password in the popup when it appears 3) Google chrome launches manually Actual Test begins: I need to enable the bridge with the manually opened Google Chrome browser and then continue the rest of the test. Do you have any solution? Your help is very much appreciated.

  • @michellecortes1176
    @michellecortes11763 жыл бұрын

    Hi Mukesh, new subscriber here. Thanks so much for your videos, I find them really easy to follow. Super Job! Just posting also this query, in the hopes, you could help me. I tried to follow your steps here, but I was getting this error: org.openqa.selenium.WebDriverException: unknown error: cannot connect to chrome at localhost:9988 What should I do? Thanks in advance for the response :)

  • @sdetworld8997

    @sdetworld8997

    3 жыл бұрын

    I too faced this, from google which helped later, Also mukesh was mentioning the chome should be the default browser.. May be this will work if user "chrome.exe --remote-debugging-port= --no-default-browser-check --user-data-dir="

  • @michellecortes1176

    @michellecortes1176

    3 жыл бұрын

    @@sdetworld8997 THank you for the response, yes my chrome is set to default, and the command above though sadly didn't work for me

  • @RekhaDeshmane-p6r
    @RekhaDeshmane-p6r20 күн бұрын

    Can we execute same on safari?

  • @Mukeshotwani

    @Mukeshotwani

    17 күн бұрын

    No

  • @iyogi23
    @iyogi233 жыл бұрын

    How to do it on a mac machine? chrome.exe wont work

  • @lisaagarwalla799
    @lisaagarwalla7992 жыл бұрын

    Hi Naveen , can i achieve the same if i am running my automation on a remote device using selenium grid . I tried but not able to acheive it . can you help me here

  • @Mukeshotwani

    @Mukeshotwani

    2 жыл бұрын

    It's Mukesh not Naveen 😜

  • @lisaagarwalla799

    @lisaagarwalla799

    Жыл бұрын

    @@Mukeshotwani hey sorry mukesh . Can you please help me here if i can acheive the same using remotewebdriver?

  • @sarbjitdeol5314
    @sarbjitdeol5314 Жыл бұрын

    sir its necessary to still open cmd

  • @Mukeshotwani

    @Mukeshotwani

    Жыл бұрын

    Yes Sir. Once you close the cmd the port number will be released and you won't be able to interact.

  • @sarbjitdeol5314

    @sarbjitdeol5314

    Жыл бұрын

    can you send the python scrpit for run script automatically open cmd and with command

  • @johnmichaelsampedro2828
    @johnmichaelsampedro2828 Жыл бұрын

    I am getting error 500. How to solve it?

Келесі