diff --git a/src/main/java/ru/sbtqa/tag/pagefactory/drivers/TagWebDriver.java b/src/main/java/ru/sbtqa/tag/pagefactory/drivers/TagWebDriver.java index 8154371..24ac209 100644 --- a/src/main/java/ru/sbtqa/tag/pagefactory/drivers/TagWebDriver.java +++ b/src/main/java/ru/sbtqa/tag/pagefactory/drivers/TagWebDriver.java @@ -89,6 +89,8 @@ public class TagWebDriver { private static final String WEBDRIVER_OS_ARCHITECTURE = Props.get("webdriver.os.arch"); private static final String WEBDRIVER_BROWSER_PATH = Props.get("webdriver.browser.path"); private static final String WEBDRIVER_BROWSER_SIZE = Props.get("webdriver.browser.size"); + private static final boolean WEBDRIVER_BROWSER_START_MAXIMIZED = + Boolean.parseBoolean(Props.get("webdriver.browser.startMaximized", "true")); private static final String MAPPING_FILES_PATH = "drivers/mapping/"; private static final String MAPPING_FILES_EXTENSION = ".json"; @@ -156,7 +158,10 @@ private static void createDriver() throws UnsupportedBrowserException, Malformed setWebDriver(new RemoteWebDriver(remoteUrl, capabilities)); } webDriver.manage().timeouts().pageLoadTimeout(getTimeOutInSeconds(), TimeUnit.SECONDS); - webDriver.manage().window().maximize(); + + if (WEBDRIVER_BROWSER_START_MAXIMIZED) { + webDriver.manage().window().maximize(); + } if (!WEBDRIVER_BROWSER_SIZE.isEmpty()) { String[] size = WEBDRIVER_BROWSER_SIZE.split("x"); diff --git a/src/main/resources/config/application.properties-sample b/src/main/resources/config/application.properties-sample index decdc24..436e2d3 100644 --- a/src/main/resources/config/application.properties-sample +++ b/src/main/resources/config/application.properties-sample @@ -79,11 +79,14 @@ webdriver.browser.ie.killOnDispose = false webdriver.shared = false #optional. The path where are the files to download -webdriver.upload.dir=C:\Temp\upload\ +webdriver.upload.dir = C:\Temp\upload\ #optional. Specify the size of window browser (this parameter need if you use browser in Docker container) webdriver.browser.size = 1920x1080 +#optional. True by default +webdriver.browser.startMaximized = true + #Custom desired capabilities webdriver.chrome.capability.acceptSslCerts=true webdriver.chrome.capability.options.args=user-data-dir=C:\\workspace\\user-data\\,start-maximized @@ -110,7 +113,7 @@ selenoid.containerLables = environment:testing,build-number:14353 data.type = json ## Optional. Set custom file extension for json and properties data stores data.extension = json -## Foleder with data files. For excel its path to excel file in xlsx format +## Folder with data files. For excel its path to excel file in xlsx format data.folder = src/test/resources/data ## Initial collection which will initialized by default data.initial.collection = Data \ No newline at end of file