Issue while launching the chrome browser with Run Options
I have a salesforce application where in which it has frames in the application. I was not able to identify the objects within the frame initially, but after referring the below link, I was able to highlight the objects even in the frames now by giving the run options in this way:
Browsers.Item[btChrome].RunOptions = "--disable-web-security --user-data-dir=<ProfilePath> --disable-site-isolation-trials --allow-file-access-from-files";
Link I was referring: https://community.smartbear.com/t5/TestComplete-Questions/Handle-Iframe/td-p/197679
Since I've to give the customized profile path in the above line of code, I tried in the below way,
I used the below code to launch the browser with run options using Python language:
def LaunchBrowser():
Browsers.Item[btChrome].RunOptions = "--disable-web-security --user-data-dir=C:\Users\n.thota\AppData\Local\Google\Chrome\User Data\Default --disable-site-isolation-trials --allow-file-access-from-files";
Browsers.Item[btChrome].Run();
waitForObject()
Sys.Browser().BrowserWindow(0).Maximize()
I am getting a Python runtime issue: unicode error.
I am new to python and I understand I have to do something with the profile path. I tried several ways by giving C:\\Users\\n.thota\\AppData\\Local\\Google\\Chrome\\User Data\\Default, using python literal r, but not able to get through. Can someone please help me how to give run options along with the profile path in the exact way using python
def test2(): Browsers.Item[btChrome].__setprop__('RunOptions', '--disable-web-security --user-data-dir=\"C:\\Users\\n.thota\\AppData\\Local\\Google\\Chrome\\User Data\\Default\" --disable-site-isolation-trials --allow-file-access-from-files') Browsers.Item[btChrome].Run() Sys.Browser("chrome").BrowserWindow(0).Maximize() Sys.Browser("chrome").Close()