fbpx

Finding substring in a string object

Finding substring in a string object

Home Forums Ask Expert Finding substring in a string object

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31479
    Bruce Spring
    Participant

      Attached a screen capture of the reported failure of finding a substring in a string with “.Contains”. Also included is that objects settings.

      The program fails on this line quickly, almost instantly. Unlike other instances where it can take seconds to make a decision on the Exist command for a text object.

      Thanks.

      I found a work around. If I break up the original string “AI 3 Test – Cycle 1-3” into two strings “AI 3 Test” and “Cycle 1-3” and test each for existence the test script passes.

      #31480
      Kirill Bulatnikov
      Participant

        Hello Bruce, thanks for using ZAPTEST

        For finding a substring within a string you may use Exist method but the property “Recognition Type” should be changed to “OCR Partial” – this allows partial string recognition.

        Hope that helps.
        Thanks,
        ZAPTEST Team

        #31481
        Bruce Spring
        Participant

          Using “Exist” with the “OCR (Partial)” has a much better success rate and its one less line of code in this instance.

          Thanks

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

        Virtual Expert

        ZAPTEST

        ZAPTEST Logo