Web automation failed intermittently under "Unattended Mode"

Hello,

I have a few processes doing web page automation under “Unattended Robot” -

  1. Open web browser with a particular URL, save this browser as variable.
  2. Use attach browser activity, enter user name and passwords for login purpose.
  3. Perform other operations needed on this website.

The issue is:

The process can always open web browser to go to that URL successfully, but it will failed intermittently during login, it was not able to find the user name field (default 30 sec timeout), then I added one more “Find Element” activity which points to the user name field with 60 sec timeout configured, ideally it should wait until the user name field is found, but this Find Element still failed intermittently under “Unattended Mode” due to timeout exception, whenever I log in to Robot AWS and ran it from Robot Tray, the job runs smoothly.

I also even put retry logic for the login - if any exception happened during login, kill the iexplore process, wait for 1min, and open browser to try again, this retry logic has maximum 3 times retry, but it will still fail.

I was thinking to add “Find Image” activity which will scrape the complete login screen to make sure everything has been loaded, then try to log in, but I’m afraid it will still fail because I believe “Find Element” activity will have better accuracy since it’s using exactly the same “Selector” as the field.

This has been a big headache for us since we never know when this issue would happen, it becomes really difficult to support the production processes especially when the team members are out for vacation.

Please advise!

Many thanks!
Fan

@fafeng,

Could you please give it a try with Element Exists or On Element Appear activity and check

@lakshman thanks for your advise, I will give a try for “On Element Appear”, but I doubt it will resolve this intermittent issue, because “On Element Appear” will only wait until the element appears and becomes visible.

The “Find Element” activity has 2 options - wait for active & wait for visible, in my opinion these 2 activities have very similar functions.

image

Thanks,
Fan

Hi Fan,

Have you tried attaching the selector to a live element, in case this element is intermittently changing its tags? May be worth checking this, or possibly screenshotting what the robot sees as part of a TryCatch so you can possibly identify if it’s a page error as oppose to the element tags.

Thanks @jcb, I will add a “Take Screenshot” activity to capture the web page image when exception happens for troubleshooting purpose.

Thanks,
Fan