Forum Discussion

jsc's avatar
jsc
Regular Contributor
10 years ago

Disable region checkpoints conditionally (for one pc)

Hey all,

 

I want to disable region checkpoints on one PC.

The test runs perfectly fine but we want to run the test on a different PC where all screenshot would fail.

 

I have no real idea how to implement this easily.

 

Changing OnLogCheckpoint would as far as I see the wrong place, as all screenshots would fail so each region checkpoint would lead to OnLogError. I want the checkpoint not to be executed so that there is also no auto-wait timeout each time.

 

Can anyone help me?

 

Best regards,

Joachim

 

4 Replies

  • marin's avatar
    marin
    Frequent Contributor

    Hello Joachim,

     

    you could for example get the name of the computer where test is being run with Sys.HostName.

    Then you could use the condition to enable a checkpoint or not:

     

    var machineName = Sys.HostName;
    
    if(machineName != "myMachine")
    
    {
      Regions.myRegion.Check(Regions.myRegion(Aliases.browser.myPage, 111, 222, 333,444, false));
    }
    
    

     

    You could store the Sys.HostName in your Project variables somewhere at test start and then use that as well.

     

    Hope this helps.

     

    Marin

     

     

    • jsc's avatar
      jsc
      Regular Contributor

      Hey Marin,

       

      the pc name is no problem, it is stored in a variable.

      The problem is, that the region checkpoints are called from keyword tests.

       

      So your solution will not be possible.

       

      This has to be done somehow in the event handler (which I already use to do different stuff), but I do not really have an idea how to implement this.

       

      The main problem is, that TestComplete tries 4 seconds (auto-wait timeout) if the region is correct. 

      Only Afterwards I can do some if... else... stuff via Eventhandler.

      Is there any possiblity to make TestComplete completely skip the region checkpoints called from keyword tests? (without setting auto-wait timeout to 0s)

       

      Best regards,

      Joachim

      • HKosova's avatar
        HKosova
        SmartBear Alumni (Retired)

        jsc wrote:

         

        the pc name is no problem, it is stored in a variable.

        The problem is, that the region checkpoints are called from keyword tests.


        Keyword tests have If...Then switches to run operations conditionally:

         

        if-then-checkpoint.png