Hello, i have a script to execute a testcase with specific chrome profile. However, how can i customize my script so that i can launch that testcase in headless mode? below is my script:
> // Copy the path to chromedriver.exe
> String pathToChromeDriver = 'C:\\Users\\XXXXX\\Documents\\POC_Katalon Studio\\Katalon_Studio_Windows_64-7.2.6\\configuration\\resources\\drivers\\chromedriver_win32\\chromedriver.exe'
>
> System.setProperty('webdriver.chrome.driver', pathToChromeDriver)
>
> // It is important that this chromeProfilePath ends with User Data and not with the profile folder (Profile 2)
> String chromeProfilePath = 'C:\\Users\\XXXXXXX\\AppData\\Local\\Google\\Chrome\\User Data\\'
>
> ChromeOptions chromeProfile = new ChromeOptions()
>
> chromeProfile.addArguments('user-data-dir=' + chromeProfilePath)
>
> // Here you specify the actual profile folder (Profile 2)
> chromeProfile.addArguments('profile-directory=Profile 1')
>
> WebDriver driver = new ChromeDriver(chromeProfile)
>
> driver.get(GlobalVariable.var_launchAppTest)
>
> DriverFactory.changeWebDriver(driver)
>
> //Ensure all chrome browsers are closed.
How can i modify this script to cater for headless execution?