package com.jiyun;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.TouchScreen;
import org.testng.Assert;
import org.testng.Reporter;
import org.testng.annotations.Test;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* @author syx
* @create 2022-03-27 17:44
*/
public class TestDome3 {
public static FirefoxDriver driver;
@Test(enabled = true,description = "cesi1")
public static void openFirefox() throws IOException {
try {
System.setProperty("webdriver.firefox.bin","E:\\huohu\\firefox.exe");
driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.MINUTES);
}catch (Exception | Error e){
e.printStackTrace();
Assert.fail(e.getLocalizedMessage());
}
try {
String url="http://www.baidu.com";
driver.get(url);
String title = driver.getTitle();
String usr="www.baidu.cn";
Assert.assertEquals(usr
selenium的全部代码
最新推荐文章于 2024-05-22 17:31:34 发布