Description
There are two ways of interacting with web-elements in Studio Pro using the Google Chrome browser - Chrome Native and Chrome Selenium. Due to certain differences in opearting of these methods, there can occur errors causing workflows to fail. In this article we will go through some of the possible cases.
The "Click on element" activity doesn't click on elements
Text and meaning of the error
When using the Click on element activity to perform a click on an element (or an element of the list) in the "Chrome Native" mode, nothing happens. Sometimes this behavior can be followed by a message in the browser's console: "File chooser dialog can only be shown with a user activation".
Solution
Such behavior can by caused by certain limitations of JavaScript in the "Chrome Native". There can be several possible ways to avoid this error. You can try different options and choose the most convinient one for you:
- Use the Click on image activity instead of Click on element
- Use the Click on coordinate activity instead of Click on element
- Use JavaScript for working with elements (Execute JavaScript)
- Use the "Chrome Selenium" mode.
- Use CSS/XPath-selectors
Сonsole error when using the "Click on element" activity
Text and meaning of the error
When using the Click on element activity on some websites, you may encouter an error in the console and a failure in the execution of the workflow.
The error message can look like this:
No elements were found according to your selection.
It may happen because of a wrong selector or because the element
takes more time to appear on the screen.
Try modifying the selector or increasing the element timeout and run the bot again.
Solution
This error may occur due to the pecularities of a certain website. The Chrome Native mode attaches to the opened webpage, which can contain a lot of additional data, for example, extensions. This can lead to slowing down the performance of the website. On the other hand, the standard Selenium mode deactivates this, which can potentially increase the speed of the website's response.
On top of that, it is possible that the error can occur because the wokflow is interacting with elements faster (when you use Selenium), than the elements update at the website's end. That is why it is a good practice to implement the "Wait before, sec" and "Wait after, sec" parameters depending on the design of your workflow.
Error when working with the "Set element value" activity
Text and meaning of the error
Sometimes the Set element value activity can work incorrectly when using the Selenium mode. For example it may not simply fill the input fields. "Set element value" in Selenium just updates the value
attribute of the element while "Set element value" in the Native mode updates the value
attribute and generates some necessary events for the UI to process it as the user input.
Solution
In general, it is expected to face such behaviour on some websites for the current activity. The variety of interface solutions is huge and the number of the used frameworks on websites is tremendous. It is possible that some of the frameworks or some of the particular implementations do not handle the activitiy "Set element value" in the same manner. The best practice here is to use the Input to browser activity for such tasks, because this activity is dedicated to handle these situations.