lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
506 stars 115 forks source link

is it possible to use Canopy for browser UI Automation (not for testing purposes)? #432

Closed badgh closed 6 years ago

badgh commented 6 years ago

All examples of Canopy contain code to run webdriver first, and then tests in a separate clean browser window specifically suited for only testing. If I want to use Canopy just to automate some of my browser related tasks, is it possible to do so with my default installed Chrome browser? I mean I have Chrome browser already installed in my Windows, and want to automate some of my routine tasks like login, create tab, go to page, etc. Is it possible to do with Canopy?

lefthandedgoat commented 6 years ago

The browser that is launched is your default chrome browser, but with all extensions disabled. Webdriver is just a proxy between your code and the instance of chrome used to control it.

You can use canopy for both testing and automating tasks.

If you want to attach to an existing browser, that used to not be an option, and after some quick googling, I think that is still the case.

If you want to launch chrome with your extensions, I believe you have to download the .crx file that is the extension, and launch chrome with options pointing at the the crx files you want loaded. This SO post talks about it: https://stackoverflow.com/questions/34222412/load-chrome-extension-using-selenium?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

want to automate some of my routine tasks like login, create tab, go to page, etc

This sounds like you may want an macro extension. BTW, create tab is CTRL+T or COMMAND+T on OSX.

I hope this helps and if you more questions, feel free to ask and I will do my best to help!

badgh commented 6 years ago

Thank you for prompt answer. Yes, attaching to an existing browser (with all existing settings, extensions, bookmarks, etc. intact) is exactly what i want and it's a pity it's not possible...