The Type method super slow in my script
Home › Forums › Ask Expert › The Type method super slow in my script
- This topic has 7 replies, 2 voices, and was last updated 7 years, 9 months ago by Valentin ZAP.
-
AuthorPosts
-
March 13, 2017 at 11:25 pm #31041Don RickmyreParticipant
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").ClickApplication("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").ExistElse
Application("Tests").CustomReport false, "Page did not load properly.", "Test is failed.", true
End If' Close Browser
Application("Tests").Close
March 13, 2017 at 11:31 pm #31042Valentin ZAPKeymasterGood 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 TeamMarch 13, 2017 at 11:41 pm #31043Don RickmyreParticipantI’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.
March 13, 2017 at 11:49 pm #31044Valentin ZAPKeymasterGood 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 TeamAttachments:March 14, 2017 at 12:22 am #31045Don RickmyreParticipantOk, 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:March 14, 2017 at 3:04 am #31046Valentin ZAPKeymasterThank 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:
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 TeamAttachments:March 14, 2017 at 6:32 am #31047Don RickmyreParticipantThanks 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.
March 25, 2017 at 11:57 pm #31048Valentin ZAPKeymasterGood 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. -
AuthorPosts
- You must be logged in to reply to this topic.