Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #149 from sbtqa/start-maximized-property
Browse files Browse the repository at this point in the history
add property to start browser maximized
  • Loading branch information
clicman authored Sep 11, 2018
2 parents 6a4e82f + f0c45c9 commit bc90e01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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");
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/config/application.properties-sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit bc90e01

Please sign in to comment.