1 package okw.gui.frames;
3 import java.io.IOException;
4 import java.util.ArrayList;
6 import javax.xml.xpath.XPathExpressionException;
8 import org.openqa.selenium.chrome.ChromeDriver;
9 import org.openqa.selenium.chrome.ChromeOptions;
12 import okw.OKW_Memorize_Sngltn;
13 import okw.OKW_Properties;
15 import okw.gui.adapter.selenium.SeBrowserWindow;
97 LogFunctionStart(
"SelectWindow" );
98 LogPrint(
"Do nothing here..." );
107 LogFunctionStartDebug(
"StartApp" );
113 if ( ( DriverPath = System.getProperty(
"webdriver.chrome.driver" ) ) !=
null )
115 LogPrint(
"System.Property: webdriver.chrome.driver is set: '" + DriverPath +
"'" );
116 MEM.
set(
"System.Property: webdriver.chrome.driver", DriverPath );
118 else if ( ( DriverPath = System.getenv(
"OKWChromedriverPath" ) ) !=
null )
120 LogPrint(
"System.Property: webdriver.chrome.driver is not set" );
121 LogPrint(
"EnvVar: OKWChromedriverPath='" + DriverPath +
"'" );
122 System.setProperty(
"webdriver.chrome.driver", DriverPath );
123 MEM.
set(
"System.Property: webdriver.chrome.driver", DriverPath );
124 MEM.
set(
"OKW EnvVar: OKWChromedriverPath", DriverPath );
128 LogPrint(
"System.Property: webdriver.chrome.driver is not set" );
129 LogWarning(
"Enviroment Variable 'OKWChromedriverPath' is not set!" );
131 String os_name = System.getProperty(
"os.name" );
136 System.setProperty(
"webdriver.chrome.driver",
"/Applications/chromedriver" );
139 System.setProperty(
"webdriver.chrome.driver",
"/usr/bin/chromedriver" );
142 LogError(
"Unknown Property: 'os.name'= '" + System.getProperty(
"os.name" ) +
"'" );
150 ChromeOptions options =
new ChromeOptions().addArguments( frmSeChrome_option );
157 mySeDriver.setDriver(
new ChromeDriver( options ) );
160 catch (XPathExpressionException e)
163 throw new RuntimeException( e );
165 catch (IOException e)
172 this.LogFunctionEndDebug();
176 public void StopApp()
178 LogFunctionStartDebug(
"StopApp()" );
180 mySeDriver.getDriver().close();
181 mySeDriver.getDriver().quit();
187 if (System.getProperty(
"os.name").toLowerCase().indexOf(
"windows") > -1)
189 LogPrintDebug(
"before windows taskkill Chrome " );
194 LogPrintDebug(
"before linux/osx pkill -f Chrome " );
204 LogPrintDebug(
"before catch (InterruptedException | IOException e)" );
207 LogPrintDebug(
"after catch (InterruptedException | IOException e)" );
211 LogPrintDebug(
"finaly.. " );
212 LogFunctionEndDebug();