Capture javascript alert on chrome

  • 19 April 2023
  • 5 replies

Badge +1

Is there a way to capture the text of a “vanilla” javascript alert on Google Chrome, like on the image below?



I need to capture “example text” but the capture action (even with the alternate capturing methods) can only get the title “ diz”


This kind of capture works fine on Edge and Firefox, but I need it on Chrome.

5 replies

Userlevel 5
Badge +14

@lhishivatari  Have you tried capture with COM option ?

Badge +1

@lhishivatari  Have you tried capture with COM option ?

Yes, I have tried with

  • Auto detect
  • Microsoft Active Accessibility
  • Microsoft UI Automation
  • Microsoft UI Automation (COM)

None of them work

Userlevel 3
Badge +8

@lhishivatari how did you handle it?

Badge +1

@lhishivatari how did you handle it?

Not the ideal solution but I used OCR.


As long as the window is always maximized, the javascript message will always show up on the same position.

The Recorder → Capture can’t get the message reliably, but it can capture its X, Y, Width and Height.

With those values in hand, I used OCR: Capture area and it works very well



Userlevel 2
Badge +6

Using the Recorder, instead of the “Get property” action, try using “Get all children names” which should give you the message.