Is there a way to suppress the warning displayed when accessing sites on HTTPS when using Selenium for automation? I came across the option "-trustAllSSLCertificates", but I wasn't able to get it working. I started my Selenium server the following way:
java -jar selenium-server.jar -trustAllSSLCertificates
... but I still got the security warning. Am I missing some other steps?
Just got it working. Here's how:
In addition to starting the Selenium server with -trustAllSSLCertificates option, the browser that is being launched by Selenium should be configured to use the Selenium server as its proxy.
For example: If Selenium server is started at host myselenium.mycompany.com at the default port 4444, the proxy setting is myselenium.mycompany.com:4444. One way to do automate this is to create a Firefox profile and configure the proxy to this address and port, and pass this created profile as an argument when starting the Selenium server using -firefoxProfileTemplate option.
java -jar selenium-server.jar -trustAllSSLCertificates -firefoxProfileTemplate /path/to/selenium_profile
Use Selenium RC Server 2.X (means version 2+), and run the command
java -jar selenium-server-standalone-2.X.X.jar -trustAllSSLCertificates
It is For sure working
I was looking for a programmatic way to do that and I got a nice way to do that which fits perfectly into my automation framework. Here is what I do:
//==========Create a RC Configuratoion object and Set trust all SSL certs to true==========
RemoteControlConfiguration rcc = new RemoteControlConfiguration();
rcc.setTrustAllSSLCertificates(true);
//====Create a SeleniumServer object using the configuration=====================
SeleniumServer serv = new SeleniumServer(rcc);
serv.start
Related
According to the codeception's documentation, you can run tests in Chrome Browser by connecting to the ChromeDriver directly without using Selenium Server.
You first need to install ChromeDriver and then launch it by running the command chromedriver --url-base=/wd/hub.
What is the purpose of --url-base=/wd/hub? Can't find it anywhere.
UPDATE
In the ChromeDriver - WebDriver for Chrome documentation, wd/hub is mentioned under the FAQ section without any explanation of what that is.
The purpose of --url-base is to define the base entry point for all the received commands.
The default entry point with chromedriver is /.
For instance to get all the sessions the client would send:
http://localhost:9515/sessions
But by default, the client (RemoteWebDriver) sends the commands to /wd/hub:
http://localhost:9515/wd/hub/sessions
Thus you need to set this flag so that the client can communicate with chromedriver.
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
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.
I am running a simple java selenium test that opens an app http://localhost:8000/ but when selenium opens the application in IE10 it opens with 8002 port instead of 4444. Because of this it always leads to 404 error and when I change the port to 4444 the test proceeds fine.
This is happening only with IE10 on Windows 8. Other browsers (chrome/firefox) seem to run the test correctly on Windows 8.
I am using latest selenium v2.25.0. This is webdriver backed selenium but I am using legacy selenium apis (ex: selenium.open())
Anybody have suggestions on how to debug this issue?
Thank you in advance!
You can feed a port parameter to selenium when you are initializing it:
selenium = new DefaultSelenium("localhost", 4444, '*firefox', siteUrl);
How to record scripts in Selenium RC? As of now, it throws security alerts at me (Trusted certificates), I'm so unable to record it. Please help me, how can we overcome this problem?
You have two options
Start the rc with -trustAllSSLCertificates parameters.Your startup command should look like
java -jar selenium-server-standalone.jar -trustAllSSLCertificates
You should create a firefox profile as mentioned here. Be sure to note down the path where the profile is being created. Then open firefox in that profile (refer the same mozilla support page if you don't how to open FF in a profile) and browse your application. You will have then be prompted to accept certificate. Accept the certificate and close the browser. Now manually open firefox using the newly created profile and access the application one more time. It should not show the certificate error now. All you need to do now is to ask selenium to use this new firefoxprofile. This can be done by using the -firefoxProfileTemplate parameter during selenium server startup
java -jar seleniumserver.jar -firefoxProfileTemplate="Path to firefoxprofile folder"