首页 > 解决方案 > 登录后切换到加载页面

问题描述

任何人都关心如何在黄瓜的另一个场景中切换到新页面,因为我无法单击新页面上加载的链接,因为编译器抱怨无法找到元素。很抱歉没有在这里发布代码,只是它是为企业服务的。

现在在新页面功能上

    @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(); 
    }

标签: javajunitcucumbergherkin

解决方案


推荐阅读