HTML Element Not Found
The functions dealing with HTML objects within a web page:
provide synchronization within the script, temporarily blocking script execution until the HTML object as specified by its HTML Descriptor is completely loaded.
If the HTML object as specified by its HTML descriptor cannot be loaded within the default timeout period of 30 seconds, the function will fail. This default timeout can be increased via the #ActionTimeout system variable. The #ActionTimeout variable can be increased just before the function and then restored to it's original value immediately following it.
Another possible reason for the HTML Element not found error is when the referenced HTML element is on the web page, but has a different HTML Descriptor than when the script was originally recorded.
Use the following step-by-step instructions to help diagnose and correct the problem.
- Execute the script in question.
- When the script fails and displays the error message, click the OK button to dismiss the message box. Leave the browser open on the web page.
- If it appears that the web page hasn't fully loaded, or the wrong web page is being displayed, you may have a synchronization error. See above how to increase the default timeout. Continue with the next step if the problem persists.
- If the correct web page is displayed and has been fully loaded, there may be a problem with the HTML Descriptor. Bring up the WinTask Editor and create a new script.
- Start Recording Mode. Select the Nothing radio button on the Start Recording Mode dialog box and click the OK button.
- Return to the browser and manually execute the steps on the web page that the script was attempting to automate.
- Stop Recording Mode. Your actions will be inserted into the new WinTask script. Restore the web page in the browser to the state it was at when the failure occurred.
- Save the newly recorded script. Compile and execute the script.
- If the new script replays correctly, compare the newly generated HTML Descriptor with the corresponding one in the script with the error. If the HTML Descriptors are identical, a synchronization error is the likely cause. See the Page Not Found article and follow it's recommendations.
- If the HTML Descriptor in the new script differs from the original script, update the original script so the HTML Descriptor matches the new script. Recompile and execute the script.
- If the script still fails after trying all of the above recommendations, please contact us at for further assistance.