Assert/VerifyElementPresent with Python and WebDriver?

前端 未结 5 2091
野趣味
野趣味 2020-12-31 01:05

I may just be confused by the change from Selenium to WebDriver and their respective documentation. In a section about test design in the documentation there is talk of usin

5条回答
  •  长发绾君心
    2020-12-31 01:30

    Verify the Assert

    driver= webdriver.Firefox()
    
    String x =driver.findElement(By.xpath("//*[@id='userNavLabel']")).getText();
    
    System.out.println(x);
    
    //Assert.assertEquals(actual, expected)
    
    Assert.assertEquals("Anandan Aranganath", x);
    

提交回复
热议问题