How to record the selenium RC scripts due to security alerts in all browser? - selenium

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"

Related

How to get Selenium Webdriver to run on Firefox browser as a different user?

I want to open an application website on Firefox browser using Selenium Webdriver as a different user.
Currently, I am using gecko driver to open that application link, it successfully opens up the browser but unable to open the application link.
But I am able to achieve the same manually by going to Mozilla Firefox icon and clicking on
"Run as different user"
option (as shown in below image) which further open a popup for user credentials and by entering Username and Password of different user there I am able to open the application link in browser.
So, is there any way that I can achieve same process using Selenium Webdriver and opens up my application link.
Thanks in Advance!!
You should rather create Firefox profile by running firefox.exe -p to launch profile manager. Then you can instantiate firefox web driver implementation and configure it to use given profile.
Are you sure that you want to use pre-configured profile? I find much easier to manage to run drivers in private/incognito mode and set cookies manually to configure tests.
You might provide firefox_binary as a parameter for the webdriver:
http://selenium-python.readthedocs.io/api.html
firefox_binary – Instance of FirefoxBinary or full path to the Firefox
binary. If undefined, the system default Firefox installation will be used.
...so, you might use a wrapper script to run firefox as the different user (use sudo in Linux).

Integrate Fiddler With Selenium RC To Capture HTTP Headers

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

Selenium with hudson:firefox browser is not getting lanuched while selenium scripts are running through hudson

i integrated my selenium scripts (using junit) with Hudson. i invoked my job through ant . My problem was my scripts are running successfully but the fire fox browser is not getting opened. At this moment i am not using selenium grid .please provide any suggestion
Check whether you run Hudson as a service using your own account. If you want to see Firefox browser you must select Local System Account as a service runner (Log on option in service properties) Then there is a possibility to check interact with desktop checkbox and it makes browser "visible" while running your tests.

selenium rc - firefox keeps on asking for proxy?

i have created firefox template and started selenium server from command line giving -firefoxProfileTemplate "path to the profile" but still it asks for proxy?
any solutions?
Have you changed the lan settings for your new FF profile to use the proxy?
When the tests open the FF browser, check the proxy settings manually and see if its there? If not, then Selenium might still be NOT using the correct profile.

Suppress SSL security warning in Firefox when using Selenium for automation

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