How to attach debugger in chrome extension along with selenium? - google-chrome

Goal: I want to run an experiment in which I will open a list of websites and want to collect the scripts that are parsed on those websites. The way I plan to do is as follows:
using selenium webdriver I will open each website in chrome.
using chrome.debugger api I will attach a debugger and listen to Debugger.Scriptparsed event.
Problem: When I open a website in a chrome (loaded with my extension ) with selenium, it throws an error that another debugger is also attached to tab. I read here, it states that selenium webdriver is using debugger also. In that case is there a way to use these functions with selenium webdriver for chrome only?

Yes, the webdriver itself is working through the debugging protocol and you cannot use the chrome.debugger API or open the developer tools in the browser that is automated with selenium.

Related

Translate page using selenium + chrome

Is there a way to initiate translating current page in google chrome using selenium?
This is different from changing preference which translates all pages nor setting -lang as command line argument which changes google chrome's language.
I want to translate page on-demand based on the url.
I am using chromedriver + selenium web driver for c#
Thanks
You can use https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb?hl=en google chrome extension to fulfill your requirement. You can automate this utility using autoit.
To add an extension for chrome driver please refer to this link:
HOW TO CREATE .CRX FILE FROM ALREADY INSTALLED CHROME EXTENSION?
HOW TO ADD AN EXTENSION TO GOOGLE CHROME INSTANCE OF SELENIUM WEBDRIVER?

Get Chrome URL using Google Developer API or Chrome Plugin

I am trying to get current active tab URL of the chrome browser (v.35+) in VC++ application. I could succeed to capture the URL using Windows Activity Accessibility (MSAA) but I am trying to get URL using other methods also.
I have tried by WinDDE but current Chrome version 35 doesn't support it. Using WinDDE, I could get URL from IExplore and Firefox.
Is it possible to get URL using Chrome Plugin. ( I don't know how to write it ) or Is there any way to do it.
Also do Google Development APIs have COM library for C++ application like they have GetURL in chrome.extension https://developer.chrome.com/extensions/extension

Interacting with firefox using an external program

I am looking for a way to interact with a web page and enter data to certain fields in it using an external program that interact with Firefox (or Chromium) web browser. The best I could find is the console commands for the browser, but they only let you go to a certain URL and not interact with the pages' content. I have also tried looking for some extension to do the job but I could not find any. Any suggestions?
You could create Chrome extension that communicates with your application via Chrome Native Messaging API: https://developer.chrome.com/extensions/messaging.html#native-messaging
Take a look at Selenium and the tools mentioned at Selenium alternatives?.

Can you still create a Chrome packaged app in the browser with manifest 2.0?

All of the examples I've seen show apps launching in their own windows. This may be great an all for chromebook/chrome os, but is there still an option to launch in a browser tab?
No, there is no way to do that. Chrome Packaged Apps are not supposed to run inside a browser. You can, however, open URLs in a browser tab using window.open. But you won't have control of that tab after you issue the command.
If you need some sort of integration/control between your Chrome Packaged App and the browser, you can create an extension and make a communication pipe between the extension and the app - as long as both are running, using the chrome.runtime.sendMessage API.
See this sample for a simple code that does exactly that (two apps and one extension exchanging messages directly, without any server component).
chrome.app.window.create will create a new Window for an App.
If you want window manipulation, you should switch to chrome.tabs API and look for an extension instead of an App.
Reference
chrome.tabs
chrome.app.window

How to use Google Chrome with Developer Tools with Selenium RC

I can open a google chrome browser like this:
selenium = new DefaultSelenium(Server, ServerPort,
"*googlechrome", DomainURL);
but it would be really useful to have it opened with the Chrome Developer Tools enabled, to be able to debug problems when developing the tests.
I can't manage to enable them, anybody knows about this?
Thanks in advance
You need to use a custom profile that have developer tools enabled. Selenium is starting Chrome with a new clean profile each and every time you use it. Selenium 1 does not offer a mechanism for overriding this. Selenium 2's ChromeDriver, however, can use an example profile.
You can try using Firefox with Firebug