How catch text in transient pop-up?

How catch text in transient pop-up?

Home Forums Ask Expert How catch text in transient pop-up?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32467
    Marco Malziotti
    Participant

      Good morning
      Developer team explain me that they have use following component for pop-up message.
      Bootstrap Notify (see: http://bootstrap-notify.remabledesigns.com/)
      In the default configuratuon:
      $.notify({
      message: message,
      }, {
      type: type,
      allow_dismiss: true,
      newest_on_top: true,
      showProgressbar: false,
      placement: {
      from: “top”,
      align: “center”
      },
      animate: {
      enter: ‘animated fadeInDown’,
      exit: ‘animated fadeOutUp’
      },
      onClosed: () => {
      notify = null
      }
      });
      without scecify delay param, pop-up message is displaied for 5 seconds.
      I have scan pop-up with “scan-application-ui” in ZapTest and saved “Message” view (see attachement).
      Running the script we see how line 5 see the popupMessage but next line …Object(“txtMesasge”).GetText don’t catch message.
      Perhaps because in the meanwhile the pop-up has disappeared?
      Thank you very much.

      Marco Malziotti

      Attachments:
      #32469
      Sasha ZAP
      Moderator

        Hello Marco Malziotti,

        In order to capture a quick disappearing popup there is a need to prepare ZAPTEST to do 2 main things:
        1. Use only the most necessary methods, because each of the method require some processing time.
        2. To create an object that ZAPTEST will manage to locate it as quickly as possible.
        To follow these instructions you need to:
        1. Use only the Exist method and only for the Text based object.
        2. Before running the test make sure the Text object can be located in the ZAPTEST GUIMap (Use the “Calculate and show the OCR precision” icon to do so, the icon with the target image).

        Please note the following:
        If an object contains a text in it, it is best to use a Text based object (And not an image based object);
        Image based object depends on the coordinates where it is located, this means, for example, if you’ll run same test in a different screen’s resolution rate an image object may not be found – Therefore in such case there is a need to use the “Relative Object” Property or to set it in an Area object.
        More on images please check our tutorial on this at:

        Image and Area Objects


        Regarding Relative Objects you can find explanation on it at:
        https://www.zaptest.com/tutorial/login  
        Also you can find more tutorials at:

        Tutorial

        Thanks,
        ZAPTEST Team 

        #32471
        Marco Malziotti
        Participant

          Thanks
          I have:
          – use “Calculate and Show OCR precision” for txtMessage and
          – modify script as following (see new attachment):
          If (Application(“Application”).View(“Message”).Object(“txtMesasge”).Exist) then
          text = Application(“Application”).View(“Message”).Object(“txtMesasge”).GetText
          Datatable.SetValue “resultMessage”,Trim(text)
          else
          Datatable.SetValue “resultMessage”,”Error: pop-up not found”
          end if
          but at runtime, even if the “then” branch is executed, text variable is set to “” (empty string).
          Other technical details:
          – ZapTest version 19.6.14 (free version)
          – PC: Lenovo T430
          – CPU: Intel Core i5 2.6 GHz
          – RAM 4 GB

          Attachments:
          #32473
          Sasha ZAP
          Moderator

            Hello Marco Malziotti,
            1. Before running the test make sure the Text object can be located in the ZAPTEST GUIMap (Use the “Calculate and show the OCR precision” icon to do so, the icon with the target image).
            2. There is no need to use the GetText method only the Exist method, because the popup disappears very quickly there is no time to process another method ( In the final test report you will be able to see if the Exist method captured the currect text.
            Thanks,
            ZAPTEST Team

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

          Virtual Expert

          ZAPTEST

          ZAPTEST Logo