双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

selenium测试问题-简单

easy_work easy_work 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
想研究下selenium2.0怎么用,从网上找了些代码,但是运行时出现了问题,请问谁知道解决办法,或者有简单的测试工程打包给我发一个,我练练手,谢谢。我的邮箱 seabird_2000@163.com
目前遇到的问题是,执行到WebDriver driver = new FirefoxDriver()就停住了,火狐弹出来了,也没有马上报错。但是没有继续往下执行,也没有输出2,System.out.println("2");

package com.selenium;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver.Navigation;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.support.ui.Select;

public class TestHello {
WebDriver driver;

@Test
public void helloWorld() throws Exception {
System.out.println("start firefox browser...");
System.setProperty("webdriver.firefox.bin", "D:/Program Files (x86)/Mozilla Firefox/firefox.exe");
System.out.println("1");
WebDriver driver = new FirefoxDriver();
System.out.println("2");
Navigation navigation = driver.navigate();
System.out.println("3");
navigation.to("http://www.baidu.com/");
System.out.println("start firefox browser succeed...");
}
}
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
easy_work
Web 开发 81,108 成员 341,721 内容