51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 3904|回复: 6
打印 上一主题 下一主题

[原创] Day5-8测试积点任务

[复制链接]
  • TA的每日心情
    无聊
    6 小时前
  • 签到天数: 410 天

    连续签到: 1 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2018-3-22 11:12:27 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
    1测试积点
    问题:
    关于 java+selenium 定位 js 显示的代码时老是报错定位不到元素,我用 fribug 上测试 xpath
    写的没问题,但是就是提示定位不到,求助
    1. driver.get("https://flight.qunar.com/");
    2.         WebElement radioOne=driver.findElement(By.xpath("//*[@id='searchTypeSng']"));
    3.         radioOne.click();
    4.         WebElement startPlace=driver.findElement(By.xpath("//*[@id='dfsForm']/div[2]/div[1]/div/input"));

    5.         startPlace.clear();
    6.         startPlace.sendKeys("北京");
    7.         WebDriverWait wait=new WebDriverWait(driver, 10);
    8.        wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@class='qcbox-fixed js-suggestcontainer'][1]//td[contains(text(),'北京')]")));
    9.        WebElement endPlace1=driver.findElement(By.xpath("//div[@class='qcbox-fixed js-suggestcontainer'][1]//td[contains(text(),'北京')]"));
    复制代码


    附firbug截图


    附件: 您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏1
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-5-10 15:15 , Processed in 0.069194 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表