Help, please, dv question Selenium ChromeDriver.
Can I work in an already open Chrome browser? Or is it possible to open a new tab in an already open Chrome browser and work in it?
No, I do not believe this is possible.
They go to reasonable lengths to make Chrome display that it is being controlled by test software and presumably attaching to an existing browser window would create a vector for people to highjack the browser of unwitting users.
Related
This question already has an answer here:
Security Considerations - ChromeDriver - Webdriver for Chrome
(1 answer)
Closed 2 years ago.
I need to use chrome driver to automate web navigation using selenium.
However, the work computer that I use did not like it, I had to bypass a couple of security blocks. When I dowloaded chrome driver I tried to run it in the cmd terminal which threw up a link and a recommendation that I should read its contents. the link was the following:
https://chromedriver.chromium.org/security-considerations
The link's web page contained a series of warnings about running chrome driver on a computer that has privileged access to information. My computer happens to have just that.
I need to find a way of automating website navigation with or without chrome driver, what should I do??
This is probably because it can do stuff like access websites that you might not want to access, either because its private data or because its a site that you arent allowed to access by law. Pretty sure that, as long as you dont run scripts from others, and know what you are doing yourself you arent taking a risk. The main problem is, that you might not be able to cancel it anymore if it runs once. If you rather do it in another way, you can use the geckodriver from firefox, i have not had such a warning yet but i assume the risk is the same
Scenario :
There is a button/link on a page opened in chrome browser and after clicking on a button/link it will navigate to the other link and opens in systems default browser i.e. Internet Explorer.
How to change the focus from chrome browser to internet explorer in selenium?
This is not possible.
You are starting your Chrome browser using the Chromedriver. You cannot handle Internet Explorer with your Chromedriver. You would need to use the IEDriver.
But as you did not start Internet Explorer using Selenium you would need to re-use an existing session. This is officially not supported see.
Nevertheless Tarun Lalwani was able to achieve this. See here and here.
I would suggest to save the link of the button/link before clicking on it and then start a new session using Internet Explorer and navigate to the saved link.
I noticed that the ChromeDriver in Headless mode does not receive the default Profile that I created, and for this project it is necessary because I need the cookies and sessions always saved .. searching I found some topics that said Chrome in Headless mode does not accept preferences. It is true?
Another thing I noticed in Headless mode is that some sites do not identify ChormeDriver like Google Chrome, which is pretty weird. Is there any way to force this in Chrome Options?
I am using WebDriver C# for Chrome Automation. I want to attach driver to already opened Chrome Instance.
I am struggling since long time; I hope here I got correct and proper answer.
As far as I know, attaching to an existing browser is not possible, and there are not plans to implement that functionality: https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/18.
I currently have a Chrome extension that uses Chrome's APIs and plan on making a Microsoft Edge version once it opens up as well. My question is how do you work with the multiple API's?
For example, I use the following to check if the extension has just been installed or not:
chrome.runtime.onInstalled
I'm assuming for Edge it would be something like:
edge.runtime.onInstalled
What's the best way to work with both of these? Do I just duplicate the code within the file where there is a copy of the code for one and the other and presumably the browser will ignore the other browser's code? (doesn't sound like the good option)
Or is there some cross-browser framework that I should use instead?
Or is there some other solution?
And please forgive me, this is my first entry into building extensions/apps, I'm generally just a Web Designer.
Thank you!
All browsers support or
chrome.runtime.onInstalled
or
browser.runtime.onInstalled
So, the right way is to start scripts in your extension with this code:
var browser = browser || chrome
And then use browser, for example:
browser.runtime.onInstalled
(I'm sorry about my english)
Edit:
Chrome and Opera support chrome and not browser.
Firefox support chrome and browser.
Edge support browser and I don't know if it support chrome.
Anyway, my solution work in all browsers.
Update (5.8.16):
Edge support browser and not chrome.