namal wijekoon
namal wijekoon

Reputation: 101

Automation Testing with Selenium using Safari Browser

There is a problem when I'm executing selenium test scripts against the safari browser.

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;

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;

Upvotes: 0

Views: 445

Answers (1)

Vlad Ershov
Vlad Ershov

Reputation: 41

Using the latest 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 .

if (environment.production) { enableProdMode(); }

Upvotes: 0

Related Questions