H
4434 号测试 成员, 2021-07-07 17:52:11 加入
2.0k
个人主页浏览
6m24s
在线时长
  • 20210707web 作业

    2021-07-08 20:28

    public static void textControl(WebDriver driver, String name,String txt){ WebElement element = driver.findElement(By.name(name)); element.clear(); element.sendKeys(txt); } public static void loginFeizhu() throws InterruptedException { WebDriver driver = init(); driver.get("https://www.fliggy.com/"); Thread.sleep(1000); driver.findElement(By.xpath("//input[@placeholder="目的地/酒店/景点/签证等"]")).click(); Thread.sleep(1000); driver.findElement(By.xpath("//div[@class="recommend-values"]/span[contains(text(),"机票")and @data-itemindex=0]")).click(); */ textControl(driver,"depCityName", "上海")); textControl(driver,"arrCityName","长沙"); textControl(driver,"depDate","2021-07-10"); driver.findElement(By.cssSelector(".close-btn.delegate-click-381")).click(); Thread.sleep(3000); driver.findElement(By.xpath("//form[@id="J_FlightForm"]//button[text()="搜索"]")).click(); tearDown(driver); }

  • 20210707web 作业

    2021-07-07 17:55

    public ChromeDriver() {

    this(ChromeDriverService.createDefaultService(), new ChromeOptions());
    }

    public static final String CHROME_DRIVER_EXE_PROPERTY = "webdriver.chrome.driver";

    public static void main( String[] args )

    {

    System.setProperty("webdriver.chrome.driver","D:\test\driver\chromeDriver.exe");

    WebDriver driver = new ChromeDriver();

    driver.get("http://testingpai.com/");
    }
    driver.find_element_by_css_selector("fn__layer fn__layer--big").click()