Is there any way to create a virtual object?

Is there any way to create a virtual object?

Home Forums Ask Expert Is there any way to create a virtual object?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32072
    hien phan
    Participant

      Hi ZAPTEST,

      Let says I want to create a method CheckTextExist(“abc”) . What I have to do is to use the GUI and create an object anywhere on the screen then use “SetProperty” method to update text content (ORS type, text color, etc…). I wonder if there is a way to create that object programmatically (without using GUI)?

      Something like -> Application(“app”).View(“view”).CreateObject(objectName, ….)

      Thanks!

      #32073
      Kirill Bulatnikov
      Participant

        Hello hien.phan. Thanks for using ZAPTEST.

        For your task there is another solution. Simply create an object on the view and call it (for example) “TEXT”. It has “OCR Single” recognition type and you better switch it to “OCR Partial”.
        Than in the script code you can assign text value to this object using SetProperty method. And then use Exist method to check if this text presented on the screen. It will look like:
        [b][i]Application(“Application”).View(“View”).Object(“TEXT”).SetProperty “Text”,”Here is your text to validate”
        Application(“Application”).View(“View”).Object(“TEXT”).Exist[/i][/b]

        Hope that helps.

        Thanks.
        ZAPTEST Team.

        #32074
        hien phan
        Participant

          Thank you for your response. That means there is no ability to create an object via script. I have to create an object on VIEW first.
          That’s inconvenience if I want to capture a dynamic object on the many views 🙁

          #32075
          Kirill Bulatnikov
          Participant

            In fact you can use same object on many views, there is no actual difference (at least if the application is still the same). So try to use “TEXT” object validation on the several views. Simply set text property for the object to desired one.

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

          Virtual Expert

          ZAPTEST

          ZAPTEST Logo