fbpx

Need to correct my test script

Need to correct my test script

Home Forums Ask Expert Need to correct my test script

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31880
    Tam Nguyen
    Participant

      I used Calculator to calculate 1234567890 * 1234 but the ‘result’ always return 0 value. Please help me to correct test script as below:

      calc_url = “C:Windowssystem32calc.exe”
      Application(“Caculator”).Launch calc_url
      Application(“Caculator”).Type “1234567890*1234=”,20
      result = zap.Common.ConvertStrToInteger(Application(“Caculator”).View(“View”).Object(“= Standard”).Object(“0 1”).GetText)
      ac_result = 1234567890*1234
      If result = ac_result then
      Application(“Caculator”).CustomReport true,””,””,true
      Else
      Application(“Caculator”).CustomReport false,””,””,true
      End If

      Attachments:
      #31881
      Kirill Bulatnikov
      Participant

        Hello Tam. Thanks for using ZAPTEST

        For your case I suggest following:
        1. Calculated value is out of the integer range (-32768 to 32767), so you need to use Double
        2.Do you have comma separation within calc? (like I do) If yes you have to remove commas by using “replace” function

        Thus it will looks like
        result = CDbl(replace((Application(“Caculator”).View(“View”).Object(“= Standard”).Object(“0 1″).GetText),”,”,””))

        Hope that helps.
        Thanks,
        ZAPTEST Team

        #31884
        Tam Nguyen
        Participant

          Thank you for your support!!!!
          My test script works correctly.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.

        Virtual Expert

        ZAPTEST

        ZAPTEST Logo