Selenium RC 测试HTTPS
被测试的网站是一个HTTPS的网站,我先建立一个firefox的profile(3j18puwy.HTTPS),再找个profile里面加载了https的证书,之后 启动selenium的server,命令如下java -jar selenium-server-standalone-2.24.1.jar -firefoxProfileTemplate "C:\Users\nancy.xu\AppData\Roaming\Mozilla\Firefox\Profiles\3j18puwy.HTTPS"
测试代码如下package loginTest;
import org.junit.After;import org.junit.Before;import org.junit.Test;
import com.thoughtworks.selenium.*;
@SuppressWarnings("deprecation")public class testLogin extends SeleneseTestCase{ @Before public void setUp() throws Exception { selenium = new DefaultSelenium("localhost", 4444, "*firefox", "https://pimportalpl.bestbuy.com/wps/portal/");// selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.baidu.com"); selenium.start(); }
@Test public void testTest() throws Exception { selenium.open("/"); selenium.open("https://xxxxxx/wps/portal/"); //selenium.open("/index.html"); //selenium.windowsMaximize(); System.out.println(selenium.getTitle());
}
@After public void tearDown() throws Exception {// selenium.stop(); }
}
但是还是发现selenium跑的时候用的是建立的firefox profile,但是还是要确认和加载证书.
页:
[1]