The application relates to a script recording method and device for automated testing,
computer equipment and a medium. When a recording start instruction is acquired, the method listens to a trigger event of a current page, determines an element corresponding to the trigger event as a target element when the trigger event meets a preset condition, extracts a
document object model of the target element, uses a recursive
algorithm to perform upward searching on the
document object model until a
root element label corresponding to the current page is found, determines access path and position information corresponding to the target element, extracts attribute information of the access path, determines a target selector corresponding to the access path according to the attribute information, acquires a recording end instruction, generates an
executable script according to the access path, the position information and the target selector, obtains the script by triggering page information recording, has high
automation and strong
operability, does not need to understand the attributes of page elements, thereby reducing the ability requirement on a recording personnel and improving the generation efficiency of a
test script.