Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mouse movement / mouseover and JavaScript evaluation in watir

I have a JavaScript-heavy Rails app which I am testing in watir. I have two specific testing requirements:

  • I need to be able to simulate moving the mouse to a specific area of the screen (or at least triggering the onmouseover event for a div)
  • Evaluating a snippet of JavaScript once the above has happened to see if a flag is set correctly

I haven't been able to figure out how to do this in watir. Any ideas on how to do this?

like image 335
Bilal and Olga Avatar asked Apr 17 '26 05:04

Bilal and Olga


1 Answers

For the first question:

browser.div(:id, "some-id").fire_event "onmouseover"

I have no idea how to solve the second question. You could ask at watir-general.

like image 168
Željko Filipin Avatar answered Apr 20 '26 16:04

Željko Filipin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!