vmi / selenese-runner-java

Selenium IDE native format (selenese and side) interpreter.
Other
140 stars 83 forks source link

ExecuteAsyncScript not working with Firefox #332

Closed blutorange closed 2 years ago

blutorange commented 2 years ago

We have several tests that make use of executeAsyncScript. When we started running the tests on Firefox, we noticed that they failed with the error message

Expected async operation, instead received: {}

After a little bit of digging, it seems to be an issue Firefox and how ExecuteAsyncScript checks for whether an object is a promise.

I could create a simple Maven project that illustrates the cause of the error

selenese-java-exec-async-ff.zip

Unpack the file, cd into the directory, make sure you have Chrome and Firefox installed on your system, then run mvn test. This runs the same 2 tests, once with Firefox and once with Chrome. Note that it fails with Firefox.

For reference, on my system I've got Chrome Version 99.0.4844.74 (Official Build) (64-bit) and Firefox 98.0.2 (64-bit) Tested with Ubuntu and Windows, so doesn't seem to be OS-specific.


To summarize what happens, as far as I understand it, is as follows:


So it seems like we might need another way to check for whether an object is a Promise, though I'm not sure how that check could look like.