Forum Discussion

lucieneven's avatar
lucieneven
Contributor
14 years ago

TestExecute failed to run *.pjs

Hello,



This is a generic question about TestExecute.



I just installed TestExecute on two machine, one is physical machine where TestComplete was installed with license. The other machine is a virtual machine.



To verify how TestExecute works, on my physical machine i recorded a simple test case with just a few lines of script. I tried the TestExecute and it works perfectly.



Then i copied the whole project folders including *.pjs to virtual machine and try to run it after loading *.pjs with TestExecute. However, every time it failed right away.



Enclosed is the test report, i took a look and no hints there. As designed, it should launch the explorer. In fact, nothing happens and then exception TestComplete log popup directly.



Just for the information, i activiated licence for TestExecute on my physical machine but failed to do that on virtual machine. I assumed the license can't be activiated twice.



I was under impression that TestExecute can work on any other machine. Please correct me if i'm wrong.



Anyway, please help shed some light here, great thanks!



Lucien

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    According to the test log you posted:



    "C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE" is not found on the TestExecute box...



    I'm assuming you did the recording on 64 bit box and you're attempting to execute it on on a 32 bit box...



    Could you confirm this?
  • Hello,



    I remember i choosed the 32bits as IE explorer. But yes, my TestComplete was installed on 64bits Win7, and i failed to run on 32bits WinXP.



    To verify this, i back to Win7 and debug that script, as can be seen from 2011-12-02 2-03-38 PM.png, it invoked the 32bits IE.



    So, based on the situation that i recorded the script on 64bits Win7 and execute on 32bits WinXP, what i can do to get TestExecute work?



    Thank you Robert!



    Lucien
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Internet Explorer resides in different folders on 64 bit vs. 32 bit installations.  On 64 bit, there are two Program Files folders, one for 64 bit apps, one for 32 bit apps... on 32 bit, there's only one folder.



    so, as I noted above, your project is looking to the folder that exists on your 64 bit environment...and such folder does not exist on your 32 bit environment.



    What you need to do then is, at the start of your test, adjust the execution of IEXPLORE to point to the appropriate folder.



    You can use Sys.OSInfo.Windows64bit to detect what OS you're on.



    so, rough code (untested) would look something like this.





    function RunIE()

    {

        var Is64Bit = Sys.OSInfo.Windows64bit

        var ProgramFolder

        if (Is64But)

        {

            ProgramFolder = "C:\\Program Files (x86)\\Internet Explorer"

        }

        else

        {

             ProgramFolder = "C:\\Program Files\\Internet Explorer"

        }

        TestedApps.iexplore.Path = ProgramFolder

        TestedApps.iexplore.Run()

    }