Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Interactivity issues
Topic Summary: Unexpected errors and unexpected behavior
Created On: 03/30/2018 07:51 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 03/30/2018 07:51 AM
User is offline View Users Profile Print this message

Author Icon
JacobNielsen
Journeyman (50-99)

Posts: 84
Joined: 10/02/2015

We have a task that goes out to a website and downloads a file. Or, at least, it used to. The task was set up to open the URL (https://[website]/[directory]/[filename].txt) and then save it.

The site was changed recently and now you have to click on an "Agree" button to proceed to the file. So if you input the URL, it redirects to the agreement page, you click on 'Agree', and then the file comes up so it can be downloaded/saved.

I've tried using interactivity to click on the button, but for some reason, Automate can't see it. I've tried moving the mouse using all sorts of values, even entering in X and Y values, but it keeps throwing an error: "An unexpected error has occurred". Since I have no idea what that error means, because it doesn't give any other information, I don't know what the problem might be or how to fix it.

After trying all kinds of ways to get the mouse interactivity to work, I gave up and decided to try a different approach. I set it up so the page launches and then Automate sends {TAB} keystrokes until it reaches the 'Agree' button. When I ran it from within the task, it worked.

However, running it from outside the task, it's not sending enough tabs. I reduced the number of tabs the command sent so that it sent them in batches of 5. When the page comes up, Automate is sending 3 tabs, not 5.

As a test, I reduced the number to 3 and relaunched it. It sends 2 tabs instead of 3. No matter what number I put in, it sends less than its supposed to.

So here are my questions:

What does "An unexpected error has been encountered" mean in regards to interactivity?
Why is it sending fewer tabs/keystrokes than it's been instructed to?

EDIT:

After some trial and error, I found the number of tabs needed to be sent to get to the 'Agree' button. Or so I thought.

After doing some testing, there's a new glitch: the number of tabs it sends keeps changing, even though the code is the same. It takes X number of tabs to get to the button; sometimes it sends too many, sometimes not enough. The page is the same every time, so it's not that we're accessing a different page.

Any ideas as to why it's sending an ever-changing number of tabs?

SECOND EDIT:

Had an idea on how to tackle this: when the page loads, tab to an element, get its value and, if it's the button, press enter. However, it seems this might not be possible.

There is a 'Get Value' action under 'Web Browser', but I have to specify which element I want to get the value of.

Is there an action that can get the value of the currently highlighted web page element?

 Category Survey


Edited: 04/02/2018 at 10:06 AM by JacobNielsen
 04/04/2018 09:28 AM
User is offline View Users Profile Print this message

Author Icon
Alex Escalante
HelpSystems

Posts: 871
Joined: 02/26/2014

hello Jacob,

Are you testing within task builder? Or from an actual schedule/trigger? Or both?

This may be a situation where timing is a factor. Both the timing of the task itself as well as perhaps the websites reaction time.

Task builder runs at a slower speed than when running live. This is for troubleshooting purposes. But that may explain some of the "changing" reactions when running your tasks.

Some tips when using keystrokes:

1. Slow down the delay between keystrokes by adding more time. You may do so by opening the "send keystrokes" step, expanding the "advanced" tab, and changing the field "Between keystrokes, delay (milliseconds)" from the default of 25, to 75 or 100.
2. Add a 1 second pause in between each "send keystrokes" step. While this will increase the overall execution time, it will make the interactive steps much more reliable.
3. Use the "wait for window" actions to wait for specific windows to appear and more importantly, to be ready for input. If we are guessing at times, and the website takes longer or is faster than the estimated time, all other subsequent steps will fail.

If you are already employing these methods or have tried them and are still having issues, it is best to conduct a support session so we may view the problem first hand. If this is the case, please send an email to automate.support@helpsystems.com and reference this thread.

 Category Survey
AutoMate BPA Server 10 version:
Windows version:


-------------------------

Alex Escalante | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 04/06/2018 07:43 AM
User is offline View Users Profile Print this message

Author Icon
JacobNielsen
Journeyman (50-99)

Posts: 84
Joined: 10/02/2015

Hi, Alex.

Both, as I mentioned. However, I'm not sure it's a timing issue.

The task steps I'm using are

{TAB X}
Wait 10 seconds
{ENTER}

Running that from within the task will result in the correct button being highlighted and the Enter command pressing the button. Running it from the Repository, it won't tab as many times as it needs to (and it does seem to vary).

As I said, setting it to tab 5 times results in it only sending the command 3 times. If it's set to 3, it only sends 2.

I've set it up to loop as many times as needed and to send a Tab command each time. That seems to work, even without adding a 'Wait' after each tab. However, there does seem to be an issue with using the {TAB X} action; maybe something to look at in the future.

Thank you.

 Category Survey
 04/09/2018 01:58 AM
User is offline View Users Profile Print this message

Author Icon
MatsBorg
Apprentice (20-49)

Posts: 31
Joined: 05/29/2012

Maybe you can try use the "Image recognition" action? We've used this as a last resort in some situations.

Preparation steps:
Take a screenshot of the web page and cut down to only the "Apply button". Important that you do this on the machine that will run the job. If not you might run into issues because of different resolutions, different text sizes etc. This small image is your "needle image". Save the file to a folder that the process can access like "c:\temp\needle.png"

Add in your task:
1. Take a screenshot of the web browser window using the "Capture screen" action and save it to c:\temp\haystack.png
2. Add "Image recognition" action and put in paths to the haystack and needle image.
3. Hopefully you will get a match with the coordinates of the Apply button
4. Use "Move mouse" action to go to the element using the coordinates from the second step
5. Use "Click mouse" action to click on the element

 Category Survey
AutoMate BPA Server 10 version: 10.7.0
Windows version: Windows 7
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 540 guests browsing this forum, which makes a total of 540 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog