Forum Discussion

Josh_147's avatar
Josh_147
Contributor
6 years ago

How to detect title of dialog first then only decide which script to be executed? VBScript

Hi, I'm using TestComplete11 with VBScript. My situation is I have a desktop application which is RobotArm and it developed into 32bit and 64bit.   The RobotArm(x32) has the starting dialog named...
  • tristaanogre's avatar
    tristaanogre
    6 years ago

    EVery process has a propery called ProcessType.  If it's 32 bit, this will have a value of x86, if it's 64 bit, this will have a value of x64.

     

    So, you could rewrite your code like this.

     

    sub InitialDialog
    
    set w=sys.Process("RobotArm").WaitWindow("#32770", "MAIN PAGE",-1,1000)
    set w1=sys.Process("RobotArm").WaitWindow("#32770", "Home",-1,1000)
    
    if Sys.Process("RobotArm").ProcessType = "x86" then
        w = Sys.Process("RobertArm").WaitWindow("#42770", MAIN PAGE", -1, 10000);
    
    else w = Sys.Process("RobertArm").WaitWindow("#32770", "Home", -1, 10000)
        w.Window("Button", "SKIP", 1).Click
    
    end if
    
    end sub 

     

    Side Note... investigate NameMapping.  You can identify objects a LOT easier and a LOT more reliably when they are mapped.  Your "Home" page could even be contingent mapping where the choices of how to identify it are built in so you don't even need to do the "WaitWindow".