Forum Discussion

nehad's avatar
nehad
New Contributor
3 years ago

Can we use Desktop object and Browser object simultaneously in Script?

I have use case where I need identify website object and windows explorer object as well. So disabled the browser's extension with that I was able to detect window's explorer object. When I am execution code I need to enable test complete extension because of which window's object are not getting identified in script. My problem is that I need to execute script where website objects and windows object both need to be executed simultaneously. Can someone help me with that.

 

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    No problem with the scenarios like your in TestComplete. You just need to have Desktop and Web licenses and have relevant extensions enabled in File|Install Extensions dialog.

    Then your code might look like this:

    var oWindow = Aliases.DesktopApp.Window;

    var oPage = Aliases.Browser.Page;

    oWindow.Click(...);

    if (<someValue> == oPage.someTextBox.contentText)

      oWindow.someCheckBox.SetChecked(true);

    ...

     

    • nehad's avatar
      nehad
      New Contributor

      I have both desktop and web license. And both extensions are enabled. Still my code doesn't work.

      ex code: 

      var page = Sys.Browser("chrome").Page("https://<xyz>");
      var Report_header = page.Form("aspnetForm").Panel("masterBody").Panel(0).Table("viewOptions");
      var Report_lable = Report_header.Cell(0, 1).Link(1).Click()
      Sys.Process("chrome").UIAObject("SafetyDirect_Reports_Vehicle_Vehicle_Report_Google_Chrome_Neha_Dixit").UIAObject("Google_Chrome").UIAObject(1).UIAObject(2).UIAObject("Downloads_bar").UIAObject("VehicleReport*").UIAObject("Options_menu").Click();
      Here I am not able to access UIAobject, when browser extension is enabled. I want to access web page object as well as browser object in same script.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        Sys.Process("chrome").UIAObject("SafetyDirect_Reports_Vehicle_Vehicle_Report_Google_Chrome_Neha_Dixit")

        What is this SafetyDirect_Reports_Vehicle_Vehicle_Report_Google_Chrome_Neha_Dixit object (and other objects from the code line) ?
        Is it some web page element, or something injected by your application into Chrome or something else?
        Can you provide a screenshot?