visual-testingapplitools

Applitools openBase() failed with com.applitools.eyes.EyesException


I'm unable to figure out why is this code failing, I browsed through Applitools tutorials and I can't figure out what is happening here.

This is the exception being thrown:

com.applitools.eyes.EyesException: eyes.openBase() failed

                at com.applitools.eyes.EyesBase.openBase(EyesBase.java:1037)
                at com.applitools.eyes.selenium.SeleniumEyes.open(SeleniumEyes.java:246)
                at com.applitools.eyes.selenium.Eyes.open(Eyes.java:77)
                at com.applitools.eyes.selenium.Eyes.open(Eyes.java:1374)
                at BaseTests.validateWindow(BaseTests.java:49)
                at SearchTests.testSearchByFullTitle(SearchTests.java:11)

This is SearchTests:

import org.junit.Test;

public class SearchTests extends BaseTests {

    @Test
    public void testSearchByFullTitle(){
        String title = "Agile Testing";
        page.search(title);
        validateWindow();
    }
}

Validate window method:

public void validateWindow(){
    eyes.open(driver, "Automation Bookstore", "neka metoda npr: "+
            Thread.currentThread().getStackTrace()[2].getMethodName());
    eyes.checkWindow();
    eyes.close();
}

and the class throwing the exception:

protected void openBase() throws EyesException {
    openLogger();
    int retry = 0;
    do {
        try {
            if (isDisabled) {
                logger.verbose("Ignored");
                return;
            }

            sessionEventHandlers.testStarted(getAUTSessionId());

            validateApiKey();
            logOpenBase();
            validateSessionOpen();

            initProviders();

            this.isViewportSizeSet = false;

            sessionEventHandlers.initStarted();

            beforeOpen();

            RectangleSize viewportSize = getViewportSizeForOpen();
            viewportSizeHandler.set(viewportSize);

            try {
                if (viewportSize != null) {
                    ensureRunningSession();
                }
            } catch (Exception e) {
                GeneralUtils.logExceptionStackTrace(logger, e);
                retry++;
                continue;
            }

            this.validationId = -1;

            isOpen = true;
            afterOpen();
            return;
        } catch (EyesException e) {
            logger.log(e.getMessage());
            logger.getLogHandler().close();
            throw e;
        }


    } while (MAX_ITERATION > retry);

    throw new EyesException("eyes.openBase() failed");
}

Solution

  • After some debugging, I found that I had a typo in my API key. After fixing that, works as expected.