Differences in browser firefox from xclick/xtype and sendKeys?

Hi

What are the differences in browser firefox from xclick/xtype and sendKeys in Kantu ?

Examples:
XType|{KEY_ENTER}| and sendKeys|id=search|{KEY_ENTER}

It’s only the Target value the difference or there are others differences ?

In the browser firefox xtype/xclick and sendkeys have the same functions ?

I know that xclick/xtype can work in desktop too but in browser is the same of sendkeys ?

Thanks, have a nice day

On the desktop you must use XClick and XType. In the browser, use Sendkeys and Click if they work, otherwise use XClick and XType.

More details:

Sendkeys and Click work on the Javascript level. This means they triggers javascript events from inside the webpage.

Advantage:

  • Because everything happens inside the website, the commands works fine if the browser is in the background, or even when Kantu runs headless.
  • Faster than Xclick/Xtype

Disadvantage:

  • On some websites the Javascript events are not recognized. This can be either because of bad design (click/keystroke events do not reach the target) or on purpose, to prevent automation.
  • Javascript events always need to be send to a specific element, so an XPath locator is always required.
  • If the page has (i)frames, you need to be in the right frame as well. For this there is the SelectFrame command.

XType and XClick commands send native keystroke and mouse event. A website can not distinguish between an XType or you sitting at your keyboard typing.

Advantage:

  • It works always.
  • It can work with locators, but also with computer vision Xclick (image) and XClick (ocr=text)
  • If you use computer vision, (i)frames do not matter, since everything works on the surface (that is why in RPA this approach is also called “surface automation”).

Disadvantage:

  • Just like with a real human typing/clicking, it only works when the browser is in the foreground and the desktop unlocked.
1 Like

Thanks @ulrich for information