selenium测试问题-简单
想研究下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...");
}
}
目前遇到的问题是,执行到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...");
}
}
...全文
相关推荐
自动化功能测试 selenium
**执行测试**:启动Selenium Server,运行编写的测试脚本。观察测试结果,分析可能存在的问题,并进行必要的调整。
selenium自动化测试工具
同时,合理的异常处理可以确保测试在遇到错误时能够优雅地失败,提供有用的错误信息,帮助定位问题。总结起来,Selenium是一个功能强大的Web自动化测试框架,提供了多种工具和API来满足不同测试需求。
selenium2 Webdriver + Java 自动化测试实战和完全教程
此外,Selenium WebDriver 的文档丰富,社区活跃,使得学习和解决问题变得更加容易。
python+selenium+unittest自动化测试demo
在自动化测试中,Python提供了丰富的库和框架,如Selenium和Unittest,使得编写测试脚本变得简单且易于维护。2.
SimpleSeleniumTest:在Google表单上进行的简单的Selenium自动化测试
【标题】"SimpleSeleniumTest:在Google表单上进行的简单的Selenium自动化测试"涉及的是使用Selenium这个流行的Web自动化测试工具来自动化Google表单的填写和交互过程


Web 开发

