US-12619523-B2 - Identification of embedded browsers in application for automated software testing
Abstract
Software applications often incorporate an embedded browser to perform web-based operations. Not all browsers operate the same way, for example, elements within tabs in Microsoft Edge browsers use messages to communicate through web extensions, while Microsoft Internet Explorer (IE) browsers use the original browsers helper object (BHO). A consequence of the different paradigms is that certain graphical elements may be duplicated in a resource table. A test development may fail to identify the duplication and may produce extraneous or erroneous tests. By launching on a system and monitoring the system's executing processes, a browser application may be determined to be running and, if so, a refresh operation is performed on an application under test (AUT). If the AUT refresh operation results in a browser also performing a refresh, the type of embedded browser may be identified and any duplicates of the same graphical elements identified and merged for subsequent testing.
Inventors
- Gaoyang Zhou
- Kai Zhou
- Sagi Zhang
Assignees
- MICRO FOCUS LLC
Dates
- Publication Date
- 20260505
- Application Date
- 20230307
Claims (19)
- 1 . A method for configuring a testing application, comprising: executing, by a processor, an application under test (AUT) on a computing system; detecting, by the processor, that the computing system is co-executing an embedded browser with the AUT; in response to detecting the co-execution: performing, by the processor, a refresh operation on the AUT; continuously monitoring, by the processor, executing processes of the computing system during the refresh operation of the AUT; determining, from the monitoring, whether a refresh operation of the embedded browser has occurred concurrently with the refresh operation of the AUT; and when the refresh operation of the embedded browser is determined to have occurred concurrently with the refresh operation of the AUT, automatically configuring, by the processor, the testing application to: identify a plurality of graphical elements of the AUT; identify a plurality of graphical elements of the embedded browser; determine, from a record that binds the AUT and the embedded browser that the AUT and the embedded browser share a common graphical element; merge the common graphical element of the AUT and the embedded browser into a single graphical element; generate a set of tests directed exclusively to AUT elements, embedded browser elements and the merged common graphical elements; generate a test script to test the graphical element of the embedded browser; and omit generation of a test script of the AUT, thereby preventing redundant test script generation and improving automated software testing efficiency.
- 2 . The method of claim 1 , further comprising executing the testing application, wherein executing the testing application comprising executing the generated test script and reporting a result of the execution.
- 3 . The method of claim 1 , wherein generating the test script comprises recording an event performed on a merged common graphical element.
- 4 . The method of claim 1 , wherein generating the test script further comprises including an identifier of a merged common graphical element, the identifier comprising an identifier of the embedded browser utilized by the AUT and an identifier of the common graphical element within the embedded browser.
- 5 . The method of claim 1 , wherein the embedded browser comprises: a first tab associated with a first browser type; and a second tab within the first tab, the second tab associated with a second browser type different from the first browser type, wherein the common graphical element resides in the second tab.
- 6 . The method of claim 5 , further comprising testing the AUT, wherein testing the AUT comprises: generating another set of tests comprising a message directed to the graphical element of the second tab, sending the message to the second tab, and evaluating a result thereof; generating a message directed to a browser helper object (BHO) associated with the second tab; sending the message to the BHO; and evaluating the result thereof.
- 7 . The method of claim 5 , further comprising testing the AUT wherein testing the AUT comprises: generating another set of tests comprising a message directed to the graphical element of the second tab; sending the message to the second tab; evaluating a result thereof; generating a message to a browser helper object (BHO) associated with the first tab; sending the message to the BHO; and evaluating the result thereof.
- 8 . The method of claim 1 , wherein the embedded browser comprises a dynamic link library (DLL) including a web extension, the method further comprising: accessing the record that binds the embedded browser with the AUT; and accessing at least one test of another set of tests comprising a test of the embedded browser bound to the AUT, wherein the test comprises providing an input to the DLL.
- 9 . The method of claim 1 , further comprising: accessing the record that binds the embedded browser with the AUT; and accessing at least one test of another set of tests comprising a test of the embedded browser bound to the AUT, wherein the test comprises providing an input message to the embedded browser.
- 10 . The method of claim 1 , wherein determining that the system is co-executing the embedded browser with the AUT comprises: accessing a list of browsers; monitoring executing processes of the system; and when the executing processes include at least one other process matching a browser in the list of browsers in addition to the AUT, concluding that the system is co-executing the embedded browser with the AUT, wherein the executing processes of the system comprise a list of executing processes available in a task manager of the system.
- 11 . A system for configuring a testing application, comprising: at least one processor; and a computer memory; wherein the at least one processor accesses a non-transitory portion of the computer memory and instructions therein to cause the at least one processor to perform: execute an application under test (AUT) on the system; determine that the system is co-executing an embedded browser with the AUT; in response to the determination: perform a refresh operation on the AUT; continuously monitor executing processes of the system; determine, from the monitoring, whether a refresh operation of the embedded browser occurred concurrently with the refresh operation performed on the AUT; when the refresh operation of the embedded browser is determined to have occurred concurrently with the refresh operation performed on the AUT, automatically configuring the testing application to: identify a plurality of graphical elements of the AUT; identify a plurality of graphical elements of the embedded browser; determine, from a record that binds the AUT and the embedded browser that the AUT and the embedded browser share a common graphical element; merge the common graphical element of the AUT and the embedded browser into a single graphical element; generate a set of tests directed exclusively to AUT elements, embedded browser elements and merged common graphical elements; generate a test script to test the common graphical element of the embedded browser; and omit generation of a test script for the AUT thereby preventing redundant test script generation and improving automated software testing efficiency; and executing the testing application, comprising executing the generated test script and reporting a result thereof.
- 12 . The system of claim 11 , wherein generating the test script comprises recording an event performed on the common graphical element.
- 13 . The system of claim 11 , wherein generating the test script further comprises including an identifier of the common graphical element, the identifier comprising an identifier of the embedded browser utilized by the AUT and an identifier of the common graphical element within the embedded browser.
- 14 . The system of claim 11 , wherein the embedded browser comprises: a first tab associated with a first browser type; and a second tab within the first tab, the second tab associated with a second browser type different from the first browser type, wherein the common graphical element resides within the second tab.
- 15 . The system of claim 11 , wherein the at least one processor is further configured to test the AUT, comprising: generating another set of tests comprising a message directed to the common graphical element of second tab; sending the message to the second tab; evaluating the result thereof; generating a message directed to a browser helper object (BHO) associated with the second tab; sending the message to the BHO; and evaluating the result thereof.
- 16 . The system of claim 14 , wherein the at least one processor is further configured to test the AUT, comprising: generating another set of tests comprising a message directed to the graphical element of the second tab; sending the message to the second tab; evaluating the result thereof; generating a message directed to a browser helper object (BHO) associated with the first tab; sending the message to the BHO; and evaluating the result thereof.
- 17 . The system of claim 11 , wherein the embedded browser comprises a dynamic link library (DLL) including a web extension.
- 18 . The system of claim 17 , wherein the at least one processor is further configured to: accessing the record that binds the embedded browser with the AUT; and accessing at least one test of another set of tests comprising a test of the embedded browser bound to the AUT, wherein the test comprises an input to the DLL.
- 19 . The system of claim 11 , wherein the at least one processor is further configured to determine that the system is co-executing the embedded browser with the AUT comprises: accessing a list of browsers; monitoring executing processes of the system; and when the executing processes include at least one other process matching a browser in the list of browsers in addition to the AUT, concluding that the system is co-executing the embedded browser with the AUT, wherein the executing processes of the system comprise a list of executing processes available in a task manager of the system.
Description
FIELD OF THE DISCLOSURE The invention relates generally to systems and methods for identifying embedded browser applications and particularly to accurately identifying software elements for automated testing. BACKGROUND Codeless testing platforms, such as those utilizing artificial intelligence (AI), discover features of an application under test (AUT) and then select or generate tests to be performed on the AUT. An AUT may include other applications, such as web browsers, that are executed by extensions to the AUT for that application. For example, a user of the AUT, or the AUT itself, may utilize an embedded web browser as a means to interact with a web server, such as to obtain information, or perform an operation comprising the web server, or for other purposes. For example, the Microsoft Edge browser in Internet Explorer (IE) mode presents an IE browser inside an Edge tab. A client application provides a Chromium Embedded Framework (CEF). As a result, an automated testing application, such as a unified functional testing (UFT), needs to be able to correctly identify an embedded browser to access the graphical elements therein. When the UFT incorrectly identifies an embedded browser, and the graphical elements of the embedded browser, the UFT may unnecessarily generate tests directed to the AUT, which must be updated even if only the embedded browser is changed. For example, if a different (or additional) embedded browser is added or an embedded browser is removed or a relied upon feature of the embedded browser is altered, the test scripts for the AUT must be maintained accordingly. As a result, reprocessing the test scripts of the AUT is required even though the AUT itself is unchanged. Prior art solutions may add code to the source code of the AUT to make identification of an embedded browser apparent to the automated systems, such as by using a particular extension that declares a browser. However, this requires access to the source code, which may not be possible, as well as adding code that may not be included in released versions of the AUT. As a result, what is tested differs from the product as released to end users. Similarly, not detecting an embedded web browser may omit necessary tests, such as determining if the web browser will access a site known to contain malware, launch another application, or other action that is expected to be prohibited. Additionally, the AUT must properly implement the in-app browser, such as to ensure only the expected number of browser tabs or windows are correctly launched, resources are released upon closure, and the operations performed with a server, via the browser, operate as expected. For example, a user may open an application (stand-alone or itself a browser) and want to change their password, which is performed via a browser interfacing with a server). SUMMARY How an embedded browser works depends on the architecture selected by the developer. For Microsoft Edge, and any other browsers utilizing a similar architecture, tabs in the Edge browser operate differently from IE mode tabs and similar browsers. For example, IE mode tabs use the original browser helper object (BHO), which is implemented by injecting a dynamic link library (DLL) through the BHO. In contrast, Edge mode tabs use messages to communicate through extensions. In the Edge browser, an IE mode tab is contained under another Edge mode tab which means that if an IE mode tab is created in Edge browser, two tabs result, specifically, one Edge mode tab that contains an IE mode tab. When a UFT is operating on a graphical user interface (GUI) having a page utilizing IE mode, for operations such as reload or URL navigate, the UFT needs to send commands to the Edge tab containing the IE mode tab. For button click or edit box input in the page, the command is sent directly to the IE mode tab itself. A UFT that generates tests (e.g., test scripts) to test graphical elements of an embedded browser, as a test of the UFT, is unnecessarily burdened by the specifics of the embedded browser. A change to the embedded browsers, or the functionality thereof, requires tests of the UFT to be updated. An AUT with an embedded browser may appear to a user as being the same tab as that of the AUT. Additionally, a list of graphical elements to be tested may identify two different graphical elements as test object, each having a distinct runtime identifier. One is the graphical element as identified as a test object of the AUT and another is the graphical element as identified as a test object of the embedded browser, even though they are both the same graphical element. The different tabs being controlled by different extensions (e.g., an application extension of the UFT to run the AUT and a web extension to run the embedded browser). As a result, two distinct hierarchies of objects are identified in an object hierarchy. As a result, the embedded browser may be determined by the UFT as being a standalone applicatio