Auto-fix object not found error using image recognition
A system, device, system-on-a-chip, and method of automatically correcting an object not found error using image recognition are described. The method includes running a test script for testing and analysis of a web page as rendered by a web browser. The method further includes, responsive to detecting the object not found error, automatically locating a missing object associated with the object not found error. One method of locating a missing object includes using image recognition. The method also includes updating the test script with a located object. The method may also include replaying the test script.
1 . A system, comprising:
a processor; and
a memory coupled with and readable by the processor and storing a set of instructions which, when executed by the processor, cause the processor to automatically correct an object not found error by:
running a test script for testing and analysis of a web page as rendered by a web browser;
responsive to detecting the object not found error while running the test script, automatically executing a search for a missing object associated with the object not found error, wherein the search includes determining a target region where the missing object is located, and wherein the search comprises using image recognition on a captured image of a graphical user interface generated during execution of the test script, the search being initiated relative to a computed center point of the target region corresponding to an expected location of the missing object;
locating the missing object and returning information that identifies a target element attribute or path for the missing object;
updating the test script with the returned information that identifies the target element attribute or path for the missing object; and
replaying the test script.
2 . The system of claim 1 , wherein automatically locating the missing object further comprises:
using Artificial Intelligence (AI) image recognition to locate the missing object associated with the object not found error.
3 . The system of claim 2 , wherein the AI image recognition uses recognized key attributes to locate the missing object associated with the object not found error.
4 . The system of claim 3 , wherein the key attributes comprise at least one of: a tag name, an identifier, a class, a role, a type, and a name.
5 . The system of claim 3 , wherein the key attributes are determined by processing a Document Object Model (DOM) associated with the web page.
6 . The system of claim 1 , wherein automatically locating the missing object associated with the object not found error further comprises:
responsive to more than one object being located in the determined target region, selecting a topmost object for updating the test script with the returned information that identifies the target element attribute or path for the missing object.
7 . The system of claim 1 , wherein automatically locating the missing object associated with the object not found error further comprises:
responsive to more than one target region being located, determining key attributes for the missing object; and
locating the missing object based on the determined key attributes.
8 . The system of claim 1 , wherein the captured image of the graphical user interface running the test script is captured by intercepting a video image sent to a display.
9 . A computer-implemented method to automatically correct an object not found error, the method comprising:
during runtime, executing a test script for testing and analysis of a web page as rendered by a web browser;
responsive to detecting the object not found error while running the test script, automatically executing a search for a missing object associated with the object not found error, wherein the search includes determining a target region where the missing object is located, and wherein the search comprises using image recognition on a captured image of a graphical user interface generated during execution of the test script, the search being initiated relative to a computed center point of the target region corresponding to an expected location of the missing object;
locating the missing object and returning information that identifies a target element attribute or path for the missing object;
updating the test script with the returned information that identifies the target element attribute or path for the missing object; and
replaying the test script.
10 . The computer-implemented method of claim 9 , wherein automatically locating the missing object associated with the object not found error further comprises:
using Artificial Intelligence (AI) image recognition to locate the missing object associated with the object not found error.
11 . The computer-implemented method of claim 10 , wherein the AI image recognition uses recognized key attributes to locate the missing object associated with the object not found error.
12 . The computer-implemented method of claim 11 , wherein the key attributes comprise at least one of: a tag name, an identifier, a class, a role, a type, and a name.
13 . The computer-implemented method of claim 12 , wherein the key attributes are determined by processing a Document Object Model (DOM) associated with the web page.
14 . The computer-implemented method of claim 9 , further comprising:
responsive to more than one object being located in the determined target region, selecting a topmost object for updating the test script with the returned information that identifies the target element attribute or path for the missing object.
15 . The computer-implemented method of claim 9 , wherein the captured image of the graphical user interface running the test script is captured by intercepting a video image sent to a display.
16 . A non-transitory, computer-readable medium comprising a set of instructions stored which, when executed by a processor, cause the processor to automatically correct an object not found error by:
running a test script for testing and analysis of a web page as rendered by a web browser;
responsive to detecting the object not found error while running the test script, automatically executing a search for a missing object associated with the object not found error, wherein the search includes determining a target region where the missing object is located, and wherein the search comprises using image recognition on a captured image of a graphical user interface generated during execution of the test script, the search being initiated relative to a computed center point of the target region corresponding to an expected location of the missing object;
locating the missing object and returning information that identifies a target element attribute or path for the missing object;
updating the test script with the returned information that identifies the target element attribute or path for the missing object; and
replaying the test script.
17 . The non-transitory, computer-readable medium of claim 16 , wherein the set of instructions, when executed by the processor, cause the processor further to:
automatically locate the missing object associated with the object not found error using Artificial Intelligence (AI) image recognition.
18 . The non-transitory, computer-readable medium of claim 16 , wherein the set of instructions, when executed by the processor, cause the processor further to:
determine key attributes for the missing object associated with the object not found error, wherein the key attributes comprise at least one of: a tag name, an identifier, a class, a role, a type, and a name.
19 . The non-transitory, computer-readable medium of claim 16 , wherein the set of instructions, when executed by the processor, cause the processor further to:
responsive to more than one object being located in the determined target region, select a topmost object for updating the test script with the returned information that identifies the target element attribute or path for the missing object.
20 . The non-transitory, computer-readable medium of claim 16 , wherein the captured image of the graphical user interface running the test script is captured by intercepting a video image sent to a display.