com.applitools.eyes.selenium.positioning.RegionPositionCompensationFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eyes-selenium-java4 Show documentation
Show all versions of eyes-selenium-java4 Show documentation
Applitools Eyes SDK for Selenium Java WebDriver
The newest version!
package com.applitools.eyes.selenium.positioning;
import com.applitools.eyes.BrowserNames;
import com.applitools.eyes.Logger;
import com.applitools.eyes.UserAgent;
import com.applitools.eyes.selenium.Eyes;
public class RegionPositionCompensationFactory {
public static RegionPositionCompensation getRegionPositionCompensation(UserAgent userAgent, Eyes eyes, Logger logger) {
if (userAgent != null) {
if (userAgent.getBrowser().equals(BrowserNames.Firefox)) {
try {
if (Integer.parseInt(userAgent.getBrowserMajorVersion()) >= 48) {
return new FirefoxRegionPositionCompensation(eyes, userAgent, logger);
}
} catch (NumberFormatException e) {
return new NullRegionPositionCompensation();
}
} else if (userAgent.getBrowser().equals(BrowserNames.Safari)) {
return new SafariRegionPositionCompensation();
}
else if (userAgent.getBrowser().equals(BrowserNames.IE))
{
return new InternetExplorerRegionPositionCompensation();
}
}
return new NullRegionPositionCompensation();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy