Edit

Share via


Press button or click link on web page doesn't work with a file uploader

This article provides workarounds for scenarios where interacting with a file uploader on a web page using automation actions fails.

Symptoms

When you use the Press button on web page or Click link on web page action in web automation, the action doesn't work as expected if the button or link on the web page is part of a file uploader. The following HTML element is an example of a file uploader:

<SPAN style="font-size: 14px;font-style: normal;font-weight: 400"><input type="file" /></SPAN>

Cause

Web automation actions create or modify events through scripts, which inform the browser whether the event is trusted. For more information, see Event: isTrusted property.

For security reasons, browsers might restrict the simulation of events that trigger file upload operations. This restriction ensures that file upload actions are initiated by the user directly rather than through programmatic JavaScript events.

As a result, the Press button on web page and Click link on web page actions might not work when interacting with file uploaders.

Workaround

Try one of the following workarounds:

  • Use the Press button in window action to simulate user input, bypassing the browser's event validation.

    Instead of using a web element captured from a web automation action or a web browser recorder, capture the element using the Press button in window action or through a desktop recorder.

  • Use the Click link on web page action with the Send physical click option enabled.