GUI HTML Adaptor example
Description
Through the GUI HTML Adaptor, H-TEST connects with web applications based on HTML and then, it’s possible to test them. This adaptor has an important companion named Selective Mapping, who is a JavaScript assistant bringing a more friendly user interface for helping to the creation of H-TEST mappings. It’s possible to perform single tests with this adaptor or End to end tests connecting with other adaptors either.
Statement of the exercise
With an Excel and a loop, open 6 web pages: create an Excel with different URL's and collect them with H-TEST to open them in the GUI Adaptor.
Tip: use the function getNumColumns or getNumRows and use it as the end value of the loop. Use while or for loop of H-TEST.
Solving the test case
We have designed this test case using three Adaptors: the User Object Adaptor, the Excel Adaptor, and the HTML GUI Adaptor. We have also created the WHILE loop, with which we will execute the same steps, as long as the condition we indicate in the properties of the Fragment is fulfilled.
The Excel Adaptor will attempt to read and parse the Excel sheet. The necessary initialisation parameters for this example are the following:
- FilePath: represents the full path and file name of the Excel file being handled by this instance of the Excel Adaptor: C:\test\URLsNewsPapers.xlsx
- Sheet: indicates the sheet number of the Excel file we are going to work with: 1
As a part of the mapping process, you should provide the adaptor’s information, regarding to connect and use it.
-
Url: first url to locate when the adaptor is created.
-
Browser: the browser you will use in the test.
-
Validate Insert Values: it’s indicates if the adaptor should validate or not the values which receive the adaptor during the execution. By default, is unchecked. The recommendation is to maintain unchecked for performance reasons. This field is very useful in special test cases, but in general it’s not necessary to use it.
Functions we have used with HTML GUI Adaptor:
- closeAllWindows: closes all the windows of the instantiated adaptor. It will close the six windows of the six web pages that we have been opening.
- openUrl: opens a new url in the browser. It has a series of optional parameters, to check if the url was opened and timeout before verifying it. In this case we indicate the value #URL.
- takeScreenshot: takes a screenshot of each web page that has been opened.
- waitFor: wait the time in seconds that we indicate when mapping the message: 2.
This is the link to the following diagram: https://app.htest.testautomationsystemtool.com/opendiagram?id=204
Files needed to run the case
Before designing the test case, we created an xlsx file. In it we copied the six urls from six different newspapers. We have started with Row 1, Row 2,.... up to Row 6. While the column is always the same, column 3. We save it in the directory C:\test with the name we have given it, in this case C:\test\URLsNewsPapers.xlsx
Important: before executing this test case, we must check that the .xlxs file is closed, otherwise we will get an error.
Test Set Execution
When we finish executing this test case, we see if it has been executed correctly:
Capture of results
We then open the icon on the right (marked with a red arrow) and we have as a result the evidence folder, where both the log of the execution is stored, as well as all the screenshots, files, etc... if we have checked the "Evidence" box in the general settings of the diagram.
Evidence folder
Log of the execution
When returning the results, H-TEST returns a Word document, detailing the steps we have taken, the results obtained from each step, the links to the diagram and the test set, if we have clicked on download document in the Results box.
ts_Excel Adaptor - GUI HTML Adaptor Example_20.05.2024 14.31.12_20.05.2024 14.34.04.docx






No Comments