Forum Discussion

nandini_thota's avatar
nandini_thota
Contributor
3 years ago

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()
    

     

  • 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()
    

     

    • nandini_thota's avatar
      nandini_thota
      Contributor

      Hi Kim,

      Thank you for the response. I am not seeing any Python runtime issue now.

      I am seeing a different issue with smartbear testcomplete extension now: SmartBear Test Extension is not Installed or is Disabled.

       

      I am working on chrome Version 95.0.4638.54 (Official Build) (64-bit).
      Inorder to run the chrome, I am using run options as I am working on application which has frames.

      def LaunchBrowser2():
      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()

      I am getting the below error:
      SmartBear Test Extension is not Installed or is Disabled
      The test engine does not have access to internal objects, methods, and properties of the page open in Chrome. Check whether SmartBear Test Extension is installed and enabled. To install or enable the extension, you can open the following page in Chrome:
      https://chrome.google.com/webstore/detail/smartbear-test-extension/gmhjclgpamdccpomoomknemhmmialaae

      But, I see the Testcomplete extension enabled in the chrome.

       

      I referred the below link and everything is looking fine with my system:

      https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/chrome.html

       

      If I am giving the below code without using run options:

      def LaunchBrowser():

        Browsers.Item[btChrome].Run();

        waitForObject()

        Sys.Browser().BrowserWindow(0).Maximize()

       

      I can launch chrome successfully without any smartbear extension issue in chrome.

      I think there is something we need to do with run options. If I don’t use run options, I am not able to access frames in my application. So, run options is mandatory to use for my application

      Can someone help me with this?

       

      Thanks,

      Nandini

       

      • hkim5's avatar
        hkim5
        Staff

        hi,

         

        I dont think ill be able to help with the extension not being picked up.

        Mind creating a support ticket for this?https://support.smartbear.com/testcomplete/message/

        option is in the bottom left of that page.

        you can also supply the link to this community thread as a reference for our support team.