Web page UI automation solutions are built around the UI elements in the web application page. However, if a web page is loading slower than usual, the automation solution might run into run-time errors due to not being able to load the required UI elements on time. Such failures can result in the termination of the execution process. This template provides two set of xaml files which can be used to handle such instances by trying to reload the page if a particular unique UI element is not available in the web page.
Web application automation includes two main tasks.
Open browser activity to open up a browser and to load a particular web page.
Navigating to a different web page using an already open web application.
Each of the scenarios mentioned will result in a web page load. However, if the web page is not loaded as expected, there should be a way to reload the web page as a fail safe mechanism. The two template provided address the two scenarios mentioned.
WebApplicationInitiation.xaml - This xaml file will handle the first scenario mentioned.
WebApplicationPageChange.xaml - This xaml file will handle the page change of an already open application.
You can simply apply these two xaml files for your automation solution to handle web automation.
Web Application Initiation
In_RetryAttmpts: Describes the number of times you wish to retry a page reload. The default would be three attempts.
In_WebURL: The web URL you need to access.
In_PageLoadConfirmationSelector: A successful page load is identified using an unique UI element of the web page. If the UI element is available in the web page and if the existence check returns true, it is identified that the page was loaded successfully. If it's not, it will be identified as a trigger to reload the page. Provide a selector for an unique UI element of the web page for this argument.
Out_IsPageLoaded: Boolean value that describes whether the page load was successful or not.
Out_UIBrowser: Since this xaml file opens up the web browser for the first time, it will also return the Browser variable so that it can be used for further processing within the solution.
Web Application Page Change
This is very much similar to the web application initiation. The only difference of the arguments would be that this xaml file will expect one additional argument. The additional argument would be the Browser element which was returned from Web Application Initiation xaml file. It will be used to identify the browser object.
This template will ease out the handling of web page loading problems by introducing an automatic page reload option. This mechanism comes in really handy when you have web page loading issues like slowness of the system/ network or any other page loading issues.