Integrate Fiddler With Selenium RC To Capture HTTP Headers - selenium

I'm trying to use Fiddler 4.6.2.3 as the proxy for Selenium RC (the standalone server .jar file v2.53.0) in Firefox instead of Selenium RC's built-in proxy. I'm doing this because I want to take advantage of Fiddler's capabilities. I have Fiddler working correctly with Firefox for both HTTP and HTTPS. I have Selenium RC working correctly with the "*firefox" profile using the standalone Selenium RC server .jar file. What I'd like to do is replace Selenium's built-in proxy with Fiddler.
I am launching both Fiddler and Selenium RC from the same .BAT file. I launch Fiddler first, then launch a test suite using the Selenium RC standalone server. When I remark out the Fiddler launch in the .BAT file, the Selenium RC test suite executes perfectly. When I launch Fiddler, then launch the Selenium RC test suite (both from the .BAT file), Selenium RC complains that Fiddler's security certificate is a problem and the Selenium RC test suite fails.
I'm new to the world of automated testing and Selenium. I've tried using the Selenium RC command line option -avoidProxy to see if Selenium RC would somehow "find" Fiddler if it was instructed not to use its built-in proxy. That doesn't work - Selenium RC still complains about the Fiddler security certificate. I also tried using the Selenium RC -trustAllSSLCertificates command line option. That solved the Fiddler certificate problem by completely bypassing Fiddler altogether, which of course prevented the capture of any HTTP and HTTPS traffic by Fiddler.
What I would like to happen is the following:
Launch Fiddler
Launch and run the Selenium RC test suite
Fiddler captures all HTTP and HTTPS traffic as the test suite runs
Use FiddlerScript to export specific headers to a file for later analysis (I know how to do this)
Close Selenium
Close Fiddler
It feels like I've almost got this solution working. Does anyone know how to "connect" Fiddler to Selenium RC. BTW - I know that Selenium RC has supposedly been deprecated in favor of Selenium 2.0 WebDriver. However, the Selenium Website says that Selenium RC is still being maintained and is a usable product, within its constraints. I don't have a need to develop this solution in WebDriver, so if it's possible to replace Selenium RC's proxy with Fiddler that's what I prefer to do.
Thanks In Advance For Your Help -

You can use FiddlerCore in your .NET code.
Look here: FiddlerCore API by Telerik

Related

Is there a way to test web application using Selenium and either Driver Firefox or Chrome on a server Centos7 without graphical interface?

On my local machine, I arrived to test my applications with Selenium with any problems.
But, when I'm doing the same operations on a server Centos7 (I have no graphical interface), I've many errors such as web element not found.
I'm using Docker containers for selenium (hub and nodes). The installation is OK and I can see my drivers on Http://:4444/grid/console.
Does Selenium require a graphical interface for its work?
Yes. Selenium requires the browser GUI to be present - which is also called viewport.
If you want that Selenium execution happen, without the browser GUI to be present, then you need to use a headless browser, which , as the name suggests is headless, which means there would be no GUI for them.
Examples of these headless browser include PhantomJS- link. Now Chrome also has a headless mode - link, which you can specify using ChromeOptions. Cheers!

Why does Nightwatch start a Selenium server?

The Selenium docs say:
If your browser and tests will all run on the same machine, and your
tests only use the WebDriver API, then you do not need to run the
Selenium-Server; WebDriver will run the browser directly.
So why does Nightwatch even use the server? Whenever I try to run my tests they first say Starting Selenium Server.
I imagine my tests would be faster without starting a server for each. Is there a way to turn it off? Currently Selenium isn't even working for me: Why does Nightwatch / Selenium give me a 'Connection reset' error?
Nightwatch will send a http request to the webdriver server to run your tests on a web browser. You can go over the way Nightwatch.js works in detail here:
http://nightwatchjs.org/getingstarted
Nightwatch is just a task runner. You still need a server along with the task runner to actually execute your tasks. That's where Webdriver comes in. Selenium is one of the most popular Webdriver out there and is stable when paired with Nightwatch tasks. Whether to use a standalone server or not is optional and up to you.

What's difference between protractor (Selenium webdriver) VS ghostdriver (phantomjs webdriver)?

I would like to make it clear about the difference between protractor VS ghostdriver.
With protractor:
start selenium web server for testing.
multiple browser testing.
whenever it start testing, it open the browser.
With ghostdriver:
start phantomjs web server.
can be config multiple browser too.
can run separate with selenium or integrate with selenium.
My question is PhantomJS webdriver can run alone without selenium webdriver, multiple browsers and good for CI. Why do we need to run selenium and integrate selenium with phantomjs using ghostdriver?
While I'm not entirely sure I understand your question, I'll take a stab at answering it. With WebDriver, driving a browser is done via a standardized JSON-over-HTTP wire protocol. This means that you need a "server" component that understands the wire protocol to drive any particular browser. For each of the major desktop browsers (Internet Explorer, Chrome, and Firefox), there is a server component that your WebDriver code talks to (IEDriverServer.exe, chromedriver.exe, or a Firefox browser extension, respectively). PhantomJS also implements a server component that understands the WebDriver wire protocol, so the same high-level WebDriver code can be used with PhantomJS that is used with other browsers. Note that the Selenium server is not required to drive any of the browsers on the local machine.
Now, since the protocol used is simply transmitted over HTTP, that gives WebDriver the opportunity to run the WebDriver code on one machine, while driving a browser located on an entirely different machine. That's where the Selenium server comes in. The Selenium server starts an HTTP server that understands the WebDriver JSON wire protocol. When that server receives a WebDriver command, it can forward that command to another "server" component, either running on that machine (as a standalone remote server), or on yet another machine running another instance of the Selenium server (in a "grid" configuration).
So to answer your question, yes, WebDriver code can be executed against PhantomJS without using the Selenium server. It can likewise be executed against Internet Explorer, Firefox, Chrome, Safari, and some versions of Opera, all without using the Selenium server. Notice that all of this is true without mentioning Protractor at all. Since Protractor is based on WebDriverJS, as long as there's a "server" component running, whether that's a Selenium server, chromedriver.exe, IEDriverServer.exe, or PhantomJS, the driver should be able to communicate with and drive that browser. Looking at the code, it appears that WebDriverJS (and, by extension, Protractor), should be able to execute against Chrome and PhantomJS without requiring the Selenium server, but I don't know enough about Protractor's wrapping of WebDriverJS to speak with authority.

Selenium testing over multiple domains

I'm pretty new at Selenium, recently I've created a bunch of tests with Selenium-IDE and I wanted to run them through a .bat script against a selenium stand alone server so I could test in IE, Firefox, etc.
When running the tests in firefox everything goes well and they pass... now Internet Explorer (8) is another story, the testsuite uses the localhost as domain to test against.
But here's the tricky part - I have a static content provider which runs on another domain than localhost where my images, css and javascript is hosted. How can I tell Selenium Server that it's ok to use multiple domains?
I know it is disabled because of same origin policy, however firefox runs it without problems, and showing the correct css rules and images.
Well you would need to Selenium Webdriver (or Selenium RC (older version)) to do all that you just listed.
here is the page which will hep you get started.

How to configure Selenium for IE9 when using HTTPS

I'm trying to get Selenium tests to work through PHPUnit. My tests pass in Firefox, but not in IE9. In IE, no matter what combination of settings I've tried, when the Selenium server is running IE will not go directly to the page, and instead displays "There is a problem with this website's security certificate".
If I shut down Selenium, I can use IE to access the site being tested with no problems.
I've tried telling IE that the CyberVillians cert is OK, I've added the cert to IE's list of certs, and tried various Selenium Server command line options.
For what it's worth, I'm using the very latest Selenium and PHPUnit files (downloaded today).
Any ideas?
The solution was indeed to abandon using Selenium RC.
I ended up using chibimagic's Webdriver for PHP, and everything works great. I'll probably end up writing a brokering class to make in interface more like that of PHPUnit_Extensions_SeleniumTestCase. That way, I can work up test scripts using Selenium IDE, using their PHP formatter, and then just paste into my unit test.