栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

线程“ main” org.openqa.selenium.NoSuchElementException中的异常:无法找到元素:// * [@@ id='login-email']

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

线程“ main” org.openqa.selenium.NoSuchElementException中的异常:无法找到元素:// * [@@ id='login-email']

当您访问url时,

https://staging.keela.co/login
有一个阻止UI的Ajax加载器,因此我们必须等待Ajax加载器完成所有WebElement的加载,并且
email
and
password
字段变为可见。为了实现这一目标,我们将推出
ExplicitWait
WebDriverWait
ExpectedConditions
设置为
elementToBeClickable
email
field.Here是工作代码块:

System.setProperty("webdriver.gecko.driver","C:\Utility\BrowserDrivers\geckodriver.exe");WebDriver driver = new FirefoxDriver();driver.get("https://staging.keela.co/login");WebDriverWait wait = new WebDriverWait (driver, 15);WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@id='login-email']")));element.sendKeys("bandanakeela@yopmail.com");driver.findElement(By.xpath("//input[@id='login-password']")).sendKeys("keela");driver.findElement(By.xpath("//button[@]")).click();


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/670870.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号