[英]Automation Testing with Selenium using Safari Browser
There is a problem when I'm executing selenium test scripts against the safari browser.当我针对 safari 浏览器执行 selenium 测试脚本时出现问题。
This is My code: -这是我的代码:-
@Test(priority = 24)
public void testExitPopUp()throws Exception{
try {
gp.linktoExitgdpr.click();
// gp.linktoExitgdpr.sendKeys(Keys.RETURN);
logger.info("Exit Link Is Selected");
Thread.sleep(4000);
if (gp.exirtPopUpPane.isDisplayed()) {
logger.info("Pop up Window is Displayed");
Assert.assertTrue(true);
} else {
logger.info("Pop up Window is not Displayed");
captureScreen(driver, "PopUPError");
Assert.fail();
}
}catch (Exception e){
logger.info("Missing Elements (Exception)");
captureScreen(driver, "exceptionmissingelemnts");
Assert.fail();
}
}
Note: - here all the elements are called from another class.注意: - 这里所有的元素都是从另一个类调用的。 The following code shows how I fetched those Elements.
以下代码显示了我如何获取这些元素。
linktoExitgdpr - @FindBy(xpath = "/html/body/app-root/app-survey-layout/app-survey/app-survey-gdpr/div[1]/div/div[3]/div/div/div/div[3]/div[3]/a") @CacheLookup public WebElement linktoExitgdpr; linktoExitgdpr - @FindBy(xpath = "/html/body/app-root/app-survey-layout/app-survey/app-survey-gdpr/div[1]/div/div[3]/div/div/div /div[3]/div[3]/a") @CacheLookup public WebElement linktoExitgdpr;
exirtPopUpPane - @FindBy(xpath = "/html/body/app-root/app-survey-layout/app-survey/app-survey-gdpr/div[2]/p-toast/div/p-toastitem/div") @CacheLookup public WebElement exirtPopUpPane; exirtPopUpPane - @FindBy(xpath = "/html/body/app-root/app-survey-layout/app-survey/app-survey-gdpr/div[2]/p-toast/div/p-toastitem/div" ) @CacheLookup public WebElement exirtPopUpPane;
Using the latest PrimeNG 9.0.6.使用最新的 PrimeNG 9.0.6。 and Angular: 9.1.2 check that the production variable has a true value in the
enviroment.production
variable and the enableProdMode()
must be called when the project is built for production ng build --prod
.和角度:9.1.2检查生产变量的真值
enviroment.production
变量和enableProdMode()
时,项目建成生产必须名为ng build --prod
。
if (environment.production) { enableProdMode(); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.