Hi All!

I would like to set up automatic java testing with Selenium RC. Since my
site is using https and I get a certificate warning when I go there with a
browser, I thought trustAllSSLCertificates combined with *pifirefox for
proxy choice would be a good idea and therefore added it to the pom.xml aedn
the test file, as follows:

<project>
...
<dependencies>
               <dependency>

 <groupId>org.seleniumhq.selenium.client-drivers</groupId>
                       <artifactId>selenium-java-client-driver</artifactId>
                       <version>1.0.1</version>
                       <scope>test</scope>
               </dependency>
               <dependency>
                       <groupId>junit</groupId>
                       <artifactId>junit</artifactId>
                       <version>4.8.2</version>
                       <type>jar</type>
                       <scope>compile</scope>
               </dependency>
       </dependencies>

       <build>
               <plugins>
                       <plugin>
                               <groupId>org.codehaus.mojo</groupId>

 <artifactId>selenium-maven-plugin</artifactId>
                               <version>1.1</version>
                               <executions>
                                       <execution>

 <phase>pre-integration-test</phase>
                                               <goals>

 <goal>start-server</goal>
                                               </goals>
                                               <configuration>

 <trustAllSSLCertificates>true</trustAllSSLCertificates>

 <background>true</background>
                                               </configuration>
                                       </execution>
                               </executions>
                       </plugin>
               </plugins>
       </build>
</project>

The simple java test I am trying to run is as follows:

package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class loggaintest extends SeleneseTestCase {
       @Before
       public void setUp() throws Exception {
               selenium = new DefaultSelenium("localhost", 4444,
"*pifirefox", "https://my_site.web-loadtest.test.my_site.se";);
               selenium.start();
       }

       @Test
       public void testLoggaintest() throws Exception {
               selenium.open("https://my_site.web-loadtest.test.my_site.se
");
               selenium.click("link=Logga in");
               selenium.waitForPageToLoad("30000");
               selenium.type("input1", "stora");
               selenium.type("pContent", "?now?");
               selenium.click("link=Logga in");
               selenium.waitForPageToLoad("30000");

               assertTrue(selenium.isElementPresent("link=Logga ut"));
       }

       @After
       public void tearDown() throws Exception {
               selenium.stop();
       }
}

The response I get in Eclipse failure trace is as follows:

com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL =
https://my_site.web-loadtest.test.my_site.se<https://my_site.web-loadtest.test.nordnet.se/>Response_Code
= 400 Error_Message =
Could+not+proxy+https%3A%2F%2Fmy_site%2Eweb%2Dloadtest%2Etest%2Enordnet%2Ese%3A443%2F%0Ajava%2Elang%2ERuntimeException%3A+Couldn%27t+establish+SSL+handshake%2E++Try+using+trustAllSSLCertificates%2E%0Asun%2Esecurity%2Evalidator%2EValidatorException%3A+PKIX+path+building+failed%3A+sun%2Esecurity%2Eprovider%2Ecertpath%2ESunCertPathBuilderException%3A+unable+to+find+valid+certification+path+to+requested+target
 at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)

I would be incredibly happy with some suggestions as to what I can change!
It does not seem possible according to the sysadmin to get a proper
certificate for the test environment.

Thanks!
Jenny

Reply via email to