Failure to send type command
Home › Forums › Ask Expert › Failure to send type command
- This topic has 20 replies, 3 voices, and was last updated 5 years, 7 months ago by
Sasha ZAP.
-
AuthorPosts
-
June 12, 2018 at 11:42 pm #31814
Gurpreet Singh
ParticipantHi,
I am trying to write script to send type command into application under test but cannot seem to work.
i want to type “Admin” into username field. When I execute script, that step result shows passed in execution result but I don’t see “Admin” typed.
Please see attached screenshot, thanks.
Attachments:June 14, 2018 at 1:35 pm #31815Sasha ZAP
ModeratorHello gsingh2014,
In the final test report a passed step result appears when ZAPTEST managed to locate and recognize the object, the actual typing appear only in the AUT (Application Under Test) physically:
Did the “Admin” was physically typed in the AUT?Basically there are 3 ways to check it programmatically:
1. Using the “GetText” method upon the object after typing the “Admin” string, in order to output the actual printed text (This you can do by using a Message-Box).
2. Using the “CaptureBitmap” method upon the object or the entire page after typing the “Admin” string, in order to add to the final test report a screenshot of the object’s status.
3. Verify page’s status after the login UID was processed.Hope this helps.
Thanks,
ZAPTEST TeamJune 14, 2018 at 5:40 pm #31816Gurpreet Singh
Participant“Admin” was not typed in.
Although I noticed that:
When script was executed, Cursor moved in username input box but nothing got typed in.
I will try your steps.
Thanks
June 14, 2018 at 5:52 pm #31817Sasha ZAP
ModeratorHello gsingh2014,
Can you check please if when the AUT is being executed by ZAPTEST this Username input box is disabled?
Please advise.
Thanks,
ZAPTEST TeamJune 15, 2018 at 7:49 pm #31818Gurpreet Singh
ParticipantHi Sasha,
I tried step 1 and see empty message box after script is executed:
1. Using the “GetText” method upon the object after typing the “Admin” string, in order to output the actual printed text (This you can do by using a Message-Box).
Script:
Application(“Power ON”).View(“View 4”).Object(“Image Object 5”).Click
Application(“Power ON”).View(“View 5”).Object(“Image Object”).Click
Zap.Keyboard.SetTypeDelay 1000
Application(“Power ON”).View(“View 6”).Object(“Username”).Object(“txtusername”).Type “Admin”
msgbox Application(“Power ON”).View(“View 6”).Object(“Username”).Object(“txtusername”).GetTextJune 15, 2018 at 7:50 pm #31819Gurpreet Singh
ParticipantHow do I check this?
Can you check please if when the AUT is being executed by ZAPTEST this Username input box is disabled?
June 15, 2018 at 8:00 pm #31820Sasha ZAP
ModeratorHello gsingh2014,
You can check this by placing a breakpoint after the Type method, then go to the executed already AUT and check if you can type something into the Username text-box.
Basically I can check this for you only if the AUT is public (If yes then I’ll need its URL).Thanks,
ZAPTEST TeamJune 15, 2018 at 8:19 pm #31821Gurpreet Singh
ParticipantI placed breakpoint after type line and set it to wait.
I went to AUT and can type into username text box.
June 15, 2018 at 8:29 pm #31822Sasha ZAP
ModeratorThanks gsingh2014.
Can you please attach your test (attach the *.zap file) and if the AUT (Application Under Test) is public send me its URL and if not please attach also a screenshot of the page with the problematic Username text-box.
Thanks,
ZAPTEST TeamJune 15, 2018 at 9:28 pm #31855Gurpreet Singh
ParticipantThanks Sasha for your help.
I have attached script file and screenshot.
Attachments:June 15, 2018 at 10:40 pm #31856Sasha ZAP
ModeratorHello gsingh2014,
I’ve ran your test in my end and it appears your Username object cannot be recognized during runtime:
Can you please rescan this page and try again.If the above will not help do the following:
Remove the “regexpwndclass” Application’s object property value and run the test again.Thanks,
ZAPTEST TeamJune 18, 2018 at 7:42 pm #31867Gurpreet Singh
ParticipantI tried both scenarios:
1. Re-scanned the object view where Username is displayed.
2. Removed “regexpwndclass” Application’s object property valueStill no luck.
Thanks
June 18, 2018 at 8:35 pm #31868Sasha ZAP
ModeratorHello gsingh2014,
Please try the following:
1. Add another attribute to the Type method, “True” to the “UsePhysicalKeyboardEvents” attribute, so the full command will be:
Application(“Power ON”).View(“View 6”).Object(“Username”).Object(“txtusername”).Type “Admin”, 0, False, True2. If this will not help please scan again the page but this time save it with a different Application object’s name (Instead of “Power ON” Application object’s name, before saving the new scan, set a different name only for this specific window).
Thanks,
ZAPTEST TeamJune 18, 2018 at 8:35 pm #31869Sasha ZAP
ModeratorHello gsingh2014,
Please try the following:
1. Add another attribute to the Type method, “True” to the “UsePhysicalKeyboardEvents” attribute, so the full command will be:
Application(“Power ON”).View(“View 6”).Object(“Username”).Object(“txtusername”).Type “Admin”, 0, False, True2. If this will not help please scan again the page but this time save it with a different Application object’s name (Instead of “Power ON” Application object’s name, before saving the new scan, set a different name only for this specific window).
Thanks,
ZAPTEST TeamJune 18, 2018 at 8:35 pm #31870Sasha ZAP
ModeratorHello gsingh2014,
Please try the following:
1. Add another attribute to the Type method, “True” to the “UsePhysicalKeyboardEvents” attribute, so the full command will be:
Application(“Power ON”).View(“View 6”).Object(“Username”).Object(“txtusername”).Type “Admin”, 0, False, True2. If this will not help please scan again the page but this time save it with a different Application object’s name (Instead of “Power ON” Application object’s name, before saving the new scan, set a different name only for this specific window).
Thanks,
ZAPTEST Team -
AuthorPosts
- You must be logged in to reply to this topic.