使用selenium录制的loadrunner自带飞机购票小系统

package baidu;


import java.util.regex.Pattern;
import java.io.File;
import java.util.concurrent.TimeUnit;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.support.ui.Select;


public class WebTours {
  private WebDriver driver;
  private String baseUrl;
  private boolean acceptNextAlert = true;
  private StringBuffer verificationErrors = new StringBuffer();


  @BeforeClass(alwaysRun = true)
  public void setUp() throws Exception {
   // driver = new FirefoxDriver();
    baseUrl = "http://127.0.0.1:1080";
    /**
     * 遇到一个问题: 会在浏览器最上方弹出“允许.....”对话框,如果不点击运行,则无法往下运行,  每次都需要手动点击;
     * 在电脑搜索栏中输入:%APPDATA%\Mozilla\Firefox\Profiles\
     * 搜索出具体位置,  添加如下代码,先加入网站为安全网站,加入之后使用下面的代码,是从加入安全网站的浏览器中读取,这样就不需要每次都点击允许;
     */
   String firefoxProfileDir = "C:\\Users\\dell\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\9fxyphvs.default";
   FirefoxProfile profile = new FirefoxProfile(new File(firefoxProfileDir));
   driver = new FirefoxDriver(profile);
   
   
   driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }


  @Test
  public void testWebTours() throws Exception {
    driver.get(baseUr
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值