
pickleib.mobile.driver.ServiceFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pickleib Show documentation
Show all versions of Pickleib Show documentation
Pickleib library for supporting web application automation with Selenium
The newest version!
package pickleib.mobile.driver;
import context.ContextStore;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
import utils.Printer;
import java.time.Duration;
import static utils.StringUtilities.Color.*;
public class ServiceFactory {
static Printer log = new Printer(ServiceFactory.class);
public static AppiumDriverLocalService service;
static String address;
static Integer port;
public static void startService(String address, Integer port){
log.info("Starting service on " + PURPLE.getValue() + address + ":" + port + RESET.getValue());
ServiceFactory.address = address;
ServiceFactory.port = port;
service = new AppiumServiceBuilder()
.withIPAddress(address)
.usingPort(port)
.withTimeout(Duration.ofSeconds(Integer.parseInt(ContextStore.get("appium-server-launch-timeout", "45"))))
.build();
if(!Boolean.parseBoolean(ContextStore.get("detailed-logging", "false")))
ServiceFactory.service.clearOutPutStreams();
service.start();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy