java - 登录后切换到加载页面
问题描述
任何人都关心如何在黄瓜的另一个场景中切换到新页面,因为我无法单击新页面上加载的链接,因为编译器抱怨无法找到元素。很抱歉没有在这里发布代码,只是它是为企业服务的。
现在在新页面功能上
@Given("^user is logged into Gmail successfully$")
public void userIsLoggedIntoGmailSuccessfully(){
//getting current URL driver.get
("https://mail.google.com/home/");
}
@When("^user navigates to settings link$")
public void userNavigatesToSettings() {
//this is where all hell breaks loose
driver.findElement(By.xpath(".//a[contains(text(),'Settings']")).click();
}
解决方案
推荐阅读
- php - 有没有办法从 Symfony 中具有特定子角色的用户中删除所有角色?
- reactjs - 反应的状态值没有传递给道具
- json - 正斜杠而不是文件路径中的后退
- python - 使用 Python 合并和添加两个字典列表
- javascript - 如何使条形图根据chartsjs中的值改变颜色
- amazon-web-services - API Gateway - 仅当数字字段超过某个值时才允许直通
- python - 在一个非常大的项目中发现内存泄漏
- java - 我收到以下代码的“无法解析方法'snapToRoads()'”错误...如何解决?
- .net - VS 将服务引用添加到连接的服务文件夹
- r - 从层次结构创建表