- Added RuntimeCommands import and WebElement to page.py
The changes add an import for
RuntimeCommandsandWebElementtopage.py. Theexecute_js_scriptmethod is renamed toexecute_scriptand enhanced to support execution in the context of a WebElement. The method now usesRuntimeCommandsfor script evaluation. - Refactored Runtime-related commands from DomCommands to new RuntimeCommands class
The changes move all Runtime-related command templates and methods from
DomCommandsindom.pyto a newruntime.pyfile. This includesEVALUATE_TEMPLATE,CALL_FUNCTION_ON_TEMPLATE,GET_PROPERTIES, and their associated methods. The DomCommands class now uses RuntimeCommands for JavaScript evaluation. - Added Scripts constants and enhanced WebElement functionality
The changes add a new
Scriptsclass toconstants.pycontaining JavaScript snippets for common operations. Theelement.pyfile is significantly enhanced with new methods for script execution, visibility checking, and improved click handling. New exceptions are added toexceptions.pyfor better error handling.