17-02-24 08:48 AM
Good morning all,
We are currently working on a project that requires us to spy a website and download files from it. Everything worked fine until the automation began to fail. On close inspection, we observed that the web interface had changed (i.e., the website has been redesigned by the owner), and the location where the BOT used to click and download files was moved to a different section.
In addition, Google Chrome (the browser with which this automation was built) has recently been updated (about twice now), changing how downloads are handled, eventually breaking our automation.
These two incidents made us re-spy the new interface to get our automation up and running again.
Now, my questions are:
1. What is/are the best approach(es) to automating a website that constantly changes due to UI and browser improvements/updates?
2. Is there an alternative to creating an end-to-end automation of a webpage?
What we want to achieve is a solution that does not easily break, and is robust to the dynamics of webpage UIs and browser upgrades. Or should we reconsider the aspects currently being automated?
We are open to suggestions. Your kind feedback is deeply appreciated.
Thanks and best regards,
------------------------------
Kingsley David
------------------------------
18-02-24 07:50 PM
Hello Kingsley
This is definitely one of the most annoying scenarios that can occur when automating web platforms that constantly change. Therefore, I will respond to these topics based solely on my experience, and I'm eager to see other perspectives on this post.
The best approach when automating a website that undergoes frequent changes due to UI and browser improvements is, according to best practices, to set the attributes of the elements (Application Modeler) to the minimum necessary. In my experience, when dealing with such platforms, the only attribute that remains unchanged is the "WebID" (Browser Automation). Combining this with "Match Index=1" has proven to be the most reliable approach in these situations. Rarely does this fail, but if it does, I experiment with different combinations of attributes to find the most reliable one while keeping it to a minimum.
If you have the opportunity to request the IT Department to create a web service that allows you to download these files, I think that would be excellent because you can use blue prism to consume this ws. However, this option is only feasible the organization has the "availabiltiy" to help you in this situation.
Hope its help and I'm looking to see other perspectives
Regards
19-02-24 10:09 AM
Thanks a lot Daniel for these suggestion, they are well appreciated.
At the moment, the organisation has not exposed any APIs for our consumption; I really wish we could tell them not to update their UI anymore (funny though).
I will stilt wait for further suggestions from others and apply them after which I will provide the outcome of the various tests on this platform.
Warm regards,
19-02-24 11:01 AM
To add to what Daniel said, the trick is to try to anticipate which attributes might change. The most obvious one is Path, which assumes the location of the element within the HTML structure is permanent, but often with a dynamic web page, this assumption will be incorrect. The effect is that your VBO might seem fine at design-time, but later at run-time it has problems. In simple terms the techniques to deal with this challenge are:
------------------------------
John Carter
Blue Prism
------------------------------
19-02-24 01:48 PM
As others mentioned - Its always better to look other options like Web API and if it is internal application you can check whether you can access data from the database and see any view or Stored procedures exist similar to the downloadable file.
If you are able to use UI mode I prefer UI mode with the options like UIA name, UIA control Type
And if you are going to browser mode As john carter mentioned couple of good options like CSS selector, Xpath.
Other Approach i follow if some navigation or button is potential to change i used to spy in different modes and open logs on these spots( Analyze the logs and keep the one has more success rate )and if one of the regular path is filing in that particular button I used to retry with different mode. but its not good idea to implement every where but only certain spots having issues.
20-02-24 03:16 PM
Thanks Harish and John for your valuable suggestions.
We will explore these possibilities, and feedback will be provided on the most effective approach we eventually adopted.
Thanks again.
20-02-24 07:43 PM
I wholeheartedly agree with @John Carter on the use of XPath and CSS Selectors for dynamic websites. We use XPath for almost all our chromium web elements these days.
I'd just like to point out that one thing the BPU course does not mention is that DevTools has a little known feature that you can use by pressing Ctrl-F when on the "Elements" tab. This brings up a search bar which you can type XPath or CSS Selectors directly into the search box that gives you immediate feedback on whether the element is found or not.
------------------------------
Micheal Charron
RBC
Toronto, Ontario
Canada
------------------------------
26-02-24 06:42 AM
Thanks @Michael Cohen,
I have taken some time to explore the XPath and CSS alternatives, and I have had improved success using the XPath.
I used the course title suggested by @John Carter in Blue Prism University to understand the basics of matching by XPath/CSS.
Also, I used the Match ID = 1 suggested by @Daniel_Sanhueza for some other elements I was spying and recorded an improved percentage of success.
I will keep exploring both options on a use case basis to the point where we instinctively know which approach will be best suited for each scenario in question.
I will provide further updates on this thread with recent discoveries along our learning journey.
Thank you all for your support and guidance.
------------------------------
Kingsley David
------------------------------
26-02-24 11:47 AM
Dear @Kingsley David
For your post, I would like to share my experience.
------------------------------
SYED FAHEEM
RPA Developer
Arab financial Services
Manama
------------------------------
26-02-24 06:06 PM
I think this thread has a good source of information that can be useful in the near future for anyone who's looking for this kind of automation and should be on #BPTechTips
Regards!