51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2259|回复: 0
打印 上一主题 下一主题

Selenium RC 测试HTTPS

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2012-6-25 14:33:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
被测试的网站是一个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"

测试代码如下
  1. package loginTest;
  2. import org.junit.After;import org.junit.Before;import org.junit.Test;
  3. import com.thoughtworks.selenium.*;

  4. @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();            }
  5.             @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());
  6.             }
  7.             @After            public void tearDown() throws Exception {//                selenium.stop();            }
  8. }
复制代码

但是还是发现selenium跑的时候用的是建立的firefox profile,但是还是要确认和加载证书.[img][/img]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-29 06:22 , Processed in 0.104134 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表