Is is possible to initialize a new driver in already opened chrome browser page? - watir

Is is possible to initialize a new driver in already opened chrome browser page?
If it does, can anyone please mention how?
Thanks

Watir starts a browser session by sending specific capabilities to the browser driver. While it is theoretically possible that there is a way to tell the driver to connect to an existing session, it is explicitly not supported by the specification, and its usage would be actively discouraged by the Selenium / WebDriver / Watir projects.

Related

Python - Using a browser other than Chrome with webbot package

I am new to programming and my first task, which should be really simple, is to automate a proccess, where I log in in a website with my credentials, I click on some buttons and that is it. I am using Python 3.6 on windows 10.
I am trying to do it using the webbot module, which so far has come really handy but I have one big problem.
The standard browser for webbot is Google Chrome and thus the site always opens with Chrome. I need to open the site with Internet Explorer.
I have set IE as default browser, but nothing changed, Chrome would still open.
I deleted Chrome, but then when I would run the programm nothing would happen.
I checked the init.py file and the drivers folder of the module and I think that this module can only work with chrome.
Is it possible to use IE or does this mean that this package does not support this browser at all?
Which alternatives would you suggest?
Edit: If I am not mistaken Selenium does not support IE11 on windows 10, so that is not an option, unless I am mistaken.
Thanks in advance
There is no support for another browser other than Chrome (as far as the webbot module is concerned).

Editing already open website Selenium

I want to mimic mouse clicks on buttons etc. on a website which is already open in a browser(e.g. Chrome). Do you guys know if I can do this with Selenium? Or do you guys know how I can do this in general?
No, you have to launch the browser with selenium by initializing the driver. Selenium is proxying the browser so that your code can control it.
http://selenium-python.readthedocs.io/getting-started.html

How to make chromedriver remember my settings for launching an app trough the browser with python selenium?

I am making an app with Selenium and Chromedriver on Python 3.6.3,
the app opens a magnet torrent link, but the browser always asks if the user wants to launch BitTorrent("remember my choice" does not work obviously).
I want to make the whole browser invisible with the --headless flag once i'm done coding the app, so the user will not be able to click that if i decided to just leave it as it is. Could someone please tell me how to make it so that chromedriver remembers to allow launching apps through the browser? I've been looking a lot and can't find any solution. Thanks in advance for any help.
By default, ChromeDriver will create a new temporary profile for each session. In your case, you could use a custom profile (in which your BitTorrent setting is saved).
In your code tell chromedriver where the profile is located, like this:
from selenium.webdriver.chrome.options import Options
...
chrome_options = Options()
chrome_options.add_argument("user-data-dir=/path/to/your/custom/profile");
...
driver = webdriver.Chrome(chrome_options=chrome_options)

Automating browser from terminal

Is there a way to automate a server so that it can open browser at a specific time and input a given email in a form then submit it.
Yes, It can be done by using headless browsers as suggested by #TNU, I have done it using Phantom Js, Now there are many ways you can do this.
Just write a javascript in a file and schedule the job using cron from terminal.
Or you can use casperjs another library written on top of phantom Js.
Or you can use Ghost driver for connecting to phantom headless browser to execute and schedule the scripts.
Yes, you could use headless browsers, which don't have user interfaces and can be controlled programmatically. Check this list for a list of Headless Browsers

using custom browser with watir-webdriver in Ruby

How can Watir be told to use a new or custom web browser, other than the conventional :opera, :ie, :chrome or :firefox?
For example
$browser = Watir::Browser.new :firedog
What's entailed in modifying the underlying Selenium driver class if, let's say, :firedog is really just a custom build* of Firefox, or Firefox with custom parameters? (*That way I can worry about embedding a webdriver addon into my custom ff separately.)
Hoping to avoid creating a new gem, just extend the required one(s) if possible, but not sure how to do that in the Ruby implementation.
This is likely something you need to ask the folks on the Selenium Webriver list. I've added the webdriver tag, but I'm not sure how many of them hang out here.
Once a driver is created (similar to chromedriver or operadriver I'd expect) and stuff works with webdriver, then it should work for anything built on top of it such as watir-webdriver.
If you purpose is just custom profiles, adding extensions, you are free to use already implemented API. In case you have custom Firefox build, you still may add WebDriver addon to it and just override binary path to Firefox.
This all is described at http://code.google.com/p/selenium/wiki/RubyBindings

Resources