While using Katalon Studio, I encountered a situation where I needed to change the background color of an element to blue during a test. To achieve this, I included the following instruction in my script:
WebUI.executeJavaScript('document.querySelector(\'.content-header\').setAttribute(\'background\', \'blue\')', null)
After running the test, I checked the Log Viewer and found the result displayed as shown in this image link. It appears that the JavaScript executed successfully without any errors.
However, despite the successful execution of the JavaScript code, I did not observe any visible changes in the browser's display. This led me to question whether the code was actually working or if there were other factors causing it not to execute as expected throughout the test duration.