Script runs successfully only once
- This topic has 16 replies, 5 voices, and was last updated 5 years, 1 month ago by
Sasha ZAP.
- You must be logged in to reply to this topic.
Home › Forums › Ask Expert › Script runs successfully only once
I am using Free trial version to automate installation of an app.
– How I wrote the script
1. Launch the app, by executing exe.
2. Used workbench to create repository
3. Created script to launch the exe, provide username and password to start installation
The script works as expected, with the Window from which the repository was build.
Now, When I re-run the script, Zaptest can not find elements on the window and fails.
I looks like the repository element are tied with the instance of the Window and do not work with different instance.
I have attached the screenshots of my script and UI map.
I am not sure, if I am missing something here. Has anyone encountered this issue before? How do I get around this problem?
Thanks,
Shubhangi
Hello Shubhangi
Thnaks for using ZAPTEST
To make it clear – are you trying to run script on a different machine? Does it have the same Windows version?
Is the script working repeatedly in the same instance of Windows?
Thanks,
ZAPTEST Team
Hi,
I am executing the script on the same machine.
Yes the script runs if executed multiple times on same instance of the window.
Regards,
Shubhangi
Hi Kirillb,
I tried again, with a new repo. Did not work even once.
Regards,
Shubhangi
Hi Kirillib,
Will you be able to suggest any workaround ?
Regards,
Shubhangi
Hello Shubhangi
Can you try following:
Create couple of different scripts with the same application but each time running new instance of the same application.
Then check in repository explorer property of Application object. See screenshot.
Check if “regexpwndclass” and “regexpwndtitle” are remains the same or changing in different scripts. This may be the root cause of the issue.
Thanks,
ZAPTEST Team
Hi Kirillb,
Title remains same, however the class shows following for different instances.
HwndWrapper[Livedrive.exe;;7d8542e2-5178-4d9f-9cdd-2cd2ca688c48]
HwndWrapper[Livedrive.exe;;dd6f26c5-c6fd-44a3-9d9c-6f05530cf549]
IS there a way to use regex while defining the class or title ?
OK that’s exactly what I suspected of.
Please remove everything except “HwndWrapper[Livedrive.exe” from regexpwndclass. That should help.
Thanks,
ZAPTEST Team
Thank you, worked. Atlast can find the application window.
I will check rest of the script.
I also wanted to know your thoughts about following.
When I launch the app exe, application setup window is launched with username credential textboxes. The user name text box is focused by default. Hence the OCR scanner sometimes, recognises Text as ‘lEmail Address’ (String with cursor).
Sometimes this makes the script to fail. Any workaround for these situations.
Regards,
Shubhangi
Try to use “OCR Partial” recognition for this object. That should resolve the problem.
Thanks,
ZAPTEST Team
I can’t find “RegExpwndclass” or “RegExpwndtitle” in Object properties of “Repository Exporer” could you please suggest. how to find them. I’m also stuck with same issue. Only once I see the script run successfully.
Hello Vindavarapu,
The properties “RegExpwndclass” and “RegExpwndtitle” used only by an Application object.
Navigate to your application object (in script or Repository Explorer) and look in the Object Properties.
SergeyP,
I don’t find them in Object Properties section. I’ve attached the screenshot below. Please have a look.
You need to select Application object in Repository Explorer.
ok thanks!
Already have an account? Login
Check you SPAM folder if you do not see the email.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |