Get your 6-month No-Cost Opt-Out offer for Unlimited software automation!

The Type method super slow in my script

The Type method super slow in my script

Home Forums Ask Expert The Type method super slow in my script

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #31041
    Don Rickmyre
    Participant

      I created my first script based on the first sample tutorial script. I modeled mine after it, only I modified it to work with a particular website that I test. The problem I’m having is that while it works, the Type method takes about a minute or so to retrieve the username from the table and then input it on the screen. It then takes just as long to type the password on the screen. It selects the username and password fields very quickly. It just takes forever to actually type the data from the table.

      I have changed text in my script to hide the actual site url, but this is the script I’m using.

      ' parameters
      site_url = "http://samplewebsite.com/login"

      ' Launch Browser
      Application("Tests").Launch Datatable.Value("Browser"), site_url

      ' Check the title
      Application("Tests").View("View_1").Object("Title").Exist

      ' Check for Login Prompt
      If Application("Tests").View("View_1").Object("LoginPrompt").Exist Then
      ' Log in
      Application("Tests").View("View_1").Object("LabelUsername").Object("TextboxUsername").Type Datatable.Value("Username")

      ' Prevent browser hints, we will click on header (do nothing)
      Application("Tests").View("View_1").Object("LoginPrompt").Click

      Application("Tests").View("View_1").Object("LabelPassword").Object("TextboxPassword").Type Datatable.Value("Password")

      ' Click Login Button
      Application("Tests").View("View_1").Object("LOGIN").Click

      ' Check Login Status
      Application("Tests").View("View_2").Object("TitleHomePage").Exist
      Application("Tests").View("View_2").Object("UserWelcome").Exist
      Application("Tests").View("View_2").Object("Menu").Exist
      Application("Tests").View("View_2").Object("fr Manage Load Tender").Exist
      Application("Tests").View("View_2").Object("fr Admin").Exist
      Application("Tests").View("View_2").Object("fr Manage Dedicated").Exist
      Application("Tests").View("View_2").Object("Logout").Exist

      Else
      Application("Tests").CustomReport false, "Page did not load properly.", "Test is failed.", true
      End If

      ' Close Browser
      Application("Tests").Close

      #31042
      Valentin ZAP
      Keymaster

        Good afternoon, Drickmyre!

        Could you attach your simplified script (within the lines which you have posted) to check your issue on our side.

        Thank you,
        ZAPTEST Team

        #31043
        Don Rickmyre
        Participant

          I’m sorry. Are you asking me to attach the file of my actual script? And if so, is that protected from being accessed publicly by anyone? It includes usernames and passwords for a business website that I test, so I can’t have that data be available publicly. If I’m misunderstanding, please let me know. Thank you.

          #31044
          Valentin ZAP
          Keymaster

            Good afternoon, Drickmyre!

            No, we want to see the script which could replicate your issue. If you have some difficulties to share your script (hiding all data), could you replicate this issue on some public websites? Just typing the text in some text-filed.

            For example. Could you check the attached script. This script types some text into search text-box on http://www.microsoft.com website. Do you have the same problem with that?

            Thank you,
            ZAPTEST Team

            Attachments:
            #31045
            Don Rickmyre
            Participant

              Ok, in the example you provided, it typed very quickly. I am attaching my script. I have sanitized it and cut it down so that now it only goes to the site and attempts to type in the username and password. You will notice that though it takes a long time, it does eventually type in the username and password, both in Internet Explorer and Firefox. The problem is how long it takes.

              Thank you for your patience and help.

              Attachments:
              #31046
              Valentin ZAP
              Keymaster

                Thank you, Drickmyre!

                We found the problem of using Type method in your application. The reason is that after clicking on the text input the label is disappears:

                label.png

                This problem will be fixed in the next version. We will inform you.

                As workaround we can solve this problem by using the images at the left part of the text-boxes. This way we should change Recognition Type of our labels to Image. We have attached your script with updated labels. Also we updated Recognition Type of Title object to Image, because the title is not text-based object. It significantly improves performance.

                Result script and results are attached. All updated lines are marked within “‘ !!!”. All execution process (2 browsers) takes 15 seconds.

                Thank you,
                ZAPTEST Team

                #31047
                Don Rickmyre
                Participant

                  Thanks for the tip! Knowing that I can change the recognition type, as well as the scalability and precision level, has helped a lot. I’m looking forward to exploring this program some more to see how much I’ll be able to utilize it.

                  #31048
                  Valentin ZAP
                  Keymaster

                    Good afternoon, Drickmyre!

                    We have released a new version of ZAPTEST (v17.0.3) where we have improved “Type” method. Starting from this version you could use “Type” method for objects which disappears after clicking. Give it a try!

                    Thank you,
                    ZAPTEST Team.

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