Forum Discussion

rutherg's avatar
rutherg
New Contributor
13 years ago

Unable to access an application after launching with RunAs

I have successfully started Outlook as a different user account using both the RunAs option for the TestedApps and in a script.  Now I'm trying to read the Inbox using a version of the example script sent me by the helpdesk.  I put in the following statement:

   Aliases.Explorer.wndProgman.SHELLDLL_DefView.browser.Click

to take focus off the Outlook window - as suggested in the online help.  The script fails at the next statement:

   Set MSOutlook2003 = Sys.OleObject("Outlook.Application")

with the message: "Server execution failed".

Is this because I'm using the RunAs feature?  It all worked fine when I started Outlook in the "simple" mode.  How can I work with Outlook using a different user account? 

Regards,

Gail R

6 Replies

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Gail,


    I don't have Outlook 2003, but I tried to reproduce the issue with Outlook 2007 and got the same error.

    As far as I can see, this is not the problem of TestComplete, but is the problem of getting COM access to an application running under another account. You can search for some information on DCOM settings and try to change them in the Control Panel. Unfortunately, I am not of much help here. I did some experiments yesterday, but didn't get any success.


    Is it critical to keep the current user session and run Outlook under another account? Is it possible to log in under the needed account and test your application under it? You can automate the reboot and login by using the RebootAndContinue scripting method. See Rebooting Computer and Continuing Testing.

  • rutherg's avatar
    rutherg
    New Contributor
    Alex,  thank you for taking a look.  I was unable to make the Reboot and Continue work; I am working on the application server from a Thin Client and the login part of Reboot and Continue doesn't appear to be working.  Although if I login and restart TestComplete the script will continue.  I may need to just bite the bullet and login my 2nd user in a different session and run scripts from that account.
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Gail,


    I may need to just bite the bullet and login my 2nd user in a different session and run scripts from that account.


    As far as I understand, Alex wrote about automating this process using the RebootAndContinue method. For this purpose, you just need to specify the user name and password for this account as parameters of the RebootAndContinue method.


    I was unable to make the Reboot and Continue work.


    Please clarify what problems you faced. Did an error message appear? If yes, please post here the entire text of the error message. If it was some other problem, please describe it in detail.


    Also, I wanted to clarify a few moments:

    1. On which machine (local or remote) are the scripts running?

    2. Which machine (local or remote) are you trying to reboot?


    Thanks.

  • rutherg's avatar
    rutherg
    New Contributor
    Irina, 

    To answer your specifc questions:

       1.  On which machine (local or remote) are the scripts running?
      They are running on the server which is remote.  I access the server via a citrix session on a thin client.  Nothing runs "local".

       2.  Which machine (local or remote) are you trying to reboot?  The server which is remote.



    In order to see better what was happening I logged onto the server console and noted that the Reboot and Continue was working up to the point where it tried to login.  After the server rebooted a window was displayed stating: "At least one Server or Driver failed during system startup.  Use Event Viewer to examine event log."  This window requires you to click OK to dismiss.  Also, there is a window warning of system monitoring that requires you to click OK to dismiss.  After I dismissed the two "unexpected" windows the Reboot and Continue process continued with the login and ran my specified script.    However, the second "unexpected" window will always be displayed prior to login.  How can I add switches to the Reboot and Continue that will dismiss the "unexpected" windows so that the login can proceed?



    Regards,

    Gail
  • rutherg's avatar
    rutherg
    New Contributor
    Irina, et al-

    Here's a restatement of what my problem is with the Reboot and Continue (hopefully more to the point).



    On start up, before the login process, there is a consent/warning dialogue, in which the user must click "ok". If I click this while the automated process is going, it logs on automatically. Is there another argument I can pass into the function to click this button? So far, I have: RebootAndContinue("Unit1.NewUser", "password", "admin"); Like I said, all works well except for not recognizing the dialogue...  The dialogue would be considered a modal window I think.






  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Gail,


    How can I add switches to the Reboot and Continue that will dismiss the "unexpected" windows so that the login can proceed?


    Unfortunately, it's impossible. The fact is that when the RebootAndContinue method reboots the system, TestComplete isn't running. It starts right after the rebooting is finished. That's why it can perform actions only after the operating system is loaded completely.


    Is there another argument I can pass into the function to click this button?


    No, there is no such argument.


    As for a solution to this problem, I have only one recommendation: try modifying your server (somehow) so that the mentioned window doesn't appear (unfortunately, I cannot help you with this). After you do that, TestComplete will be able to log in to the system automatically.