Forum Discussion

dcase's avatar
dcase
New Contributor
20 days ago

Could not convert variant of type (Integer) into type (Dispatch)

Hi,

do u have any probling solving tips for me? 

Best regarts

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    There seems to be a type mismatch with what you are using. Is the error occurring on the line Browsers.Item(btEdge)?

    • dcase's avatar
      dcase
      New Contributor

      Hi rraghvani, yes - the error occurs in the line Browsers.Item(btEdge).

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        I can reproduce the issue. The correct way is using e.g. "chrome" as opposed to the constant value btChrome

         

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Frequent Contributor

    Hello,

    From your screen shot the value "--inPrivate" has two dashes and the command correct line "start msedge.exe -inprivate" to start Edge in private mode is with a single dash.

    As per TestComplete documentation https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/launching-browsers.html#Arguments you are setting it correct, and I failed to make it work as you are experiencing. Probably create a support incident reporting it.

    For a work around, use "Rub Code Snippet" rather than "Call Object Method".