Forum Discussion

joffre's avatar
Regular Contributor
12 years ago

Running script on Operating System x64 and x86

Hi all.

I'm trying to run the same script on Operatin System x64 and on x86.

To do so, I created the following script conditional.

  If (Sys.OSInfo.Windows64bit = True) Then

    Log.Message("The OS is x64")

    Call Aliases.iexplore1.ToURL("http://localhost/FPWeb/")

    Call CboStrConn.ClickItem("0 TS_A_ORA10_JO1")

    TxtMatricula_X64.Text = "1"

    TxtSenha_X64.Text = "fpw"



    Log.Message("The OS is x86")

    Call TestedApps.iexplore.Run(1, True)

    Call Aliases.iexplore1.ToURL("http://localhost/fpweb/")

    Call CboStrConn_X86.ClickItem("0 TS_A_ORA10_JO1")

    TxtMatricula_X86.Text = "1"

    TxtPassw_X86.Text = "fpw"

    Call TxtPassw_X86.Keys("[Enter]")

  End If

So, if the OS is x64, the script will call the TestedApp 'C:\Program Files (x86)\Internet Explorer\iexplore.exe', while if it is x86, the TestedApp will be inside 'C:\Program Files\Internet Explorer\iexplore.exe'.

The problem is that when I run the script, it starts looking for objects that doesn't exist.

Is there a better way to do this?

My entire script file is attached.