I just did this combined with your article here:
Steps:
- Removed the Capabilities I setup above that failed
- Added your CustomWebDriverFactory
- Added the capabilities I needed:
HashMap<String, Object> chromePrefs = new HashMap<String, Object>()
String strDownloadPath = RunConfiguration.getProjectDir() + GlobalVariable.Execution_DownloadPath
strDownloadPath = strDownloadPath.replace(‘/’, ‘\’)
chromePrefs.put(“download.default_directory”, strDownloadPath)
chromePrefs.put(“safebrowsing.enabled”, true)
ChromeOptions options = new ChromeOptions()
options.setExperimentalOption(“prefs”, chromePrefs)
- Updated my @BeforeTestCase with this:
WebDriver driver = CustomKeywords.'ck.CustomWebDriverFactory.createWebDriver'() DriverFactory.changeWebDriver(driver) //WebUI.openBrowser('') WebUI.maximizeWindow()
Its much easier now. Thank you so much @kazurayam glad to have you in this community. Cheers!