1

Hi I am currently writing a Test script for an ecommerce site using Seleneium IDE, this is in a testing environment in HTTP. The issue I am having is the test payment gateway 3D Secure is in HTTPS so when using FireFox the browser displays the security warning message when I am returning from the payment gateway 3D Secure HTTPS to the site testing environment.

'Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party.

Are you sure you want to continue sending this information?'

I have tried the various commands in the IDE for waitForAlert* and asertAlert* but this javascript alert just seems to over ride any of the commands I use and essentially halts the script until manual intervention is used.

I am unable to turn this particular alert off in FF from what I can assertain from various forums as it is too important to be switched off, I have tried in FF about:config

I can obviusly switch the 3D secure off to allow thee script to run, but I would prefer a complete user scenario to be tested as opposed to a test adapted to suit automation.

Many thanks in advance for your time and assistance.

weebooboo
  • 11
  • 1
  • 2

2 Answers2

4

I had exactly the same problem :

I use Selenium web driver to test against my local http server which sends redirects to https service (3DS as well btw ;). The problem is not with certs, but with this hardcoded warning of switching between https/http.

Based on the link from MacGyver's answer and this answer Key press in (Ctrl+A) Selenium WebDriver, I tested this and I can confirm it closes "Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party" dialog:

Alert alert = driver.switchTo().alert();
alert.accept();

The other solution, seems to work fine but you'll get UnhandledAlertException with latest Selenium versions (e.g. 2.25.0) :

Actions a = new Actions(driver);
a.sendKeys(Keys.ENTER).perform();
Community
  • 1
  • 1
kedzi
  • 89
  • 1
  • 5
0

Option #1:

The easiest way is to remove the option in security options for your profile: http://forums.mozillazine.org/viewtopic.php?f=38&t=665552

Option #2:

Not sure if this applies to an untrusted certifiate or your security warning, but the forum thread seemed to fit. It requires that you use Selenium RC Server.

Profiles are stored here for Firefox: %APPDATA%\Mozilla\Firefox

Profiles can be edited: http://www.dennisplucinik.com/blog/2011/02/04/how-to-install-run-multiple-firefox-versions-in-windows-simultaneously/

Follow the snippet below from this link: http://old.nabble.com/Security-Warning-on-final-page,-how-to-remove-td22907376.html

If using Firefox 3, see the following post https://developer.mozilla.org/En/Cert_override.txt

The solution I use to get past this security pop-up is only applicable to Firefox 3 browsers and might be more of an hack than a fix but it works.

  1. Run the selenium test
  2. Select "Accept this certificate permanently" when prompted by popup
  3. Click on the OK button (it might be neccessary to have a pause after this because we need to open explorer to find a file now)
  4. Open Windows Explorer and navigate to => "C:\Users\xxxxxxxx\AppData\Local\Temp\customProfileDirxxxx"
  5. This is a temparary profile created by Firefox which contains a file called "cert_override.txt"
  6. Copy "cert_override.txt" to your temp directory
  7. Stop your selenium server.
  8. Open your "selenium-server.jar" file from "c:\selenium-remote-control-xxx\selenium-server-xxx" using WinRar
  9. Drag "cert_override.txt" file into the "selenium-server.jar\customProfileDirCUSTFFCHROME" folder in WinRar (do not delete or edit anything in the .jar file!!!!!)
  10. Close WinRar, start selenium and try it again :)
JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245