vmi / selenese-runner-java

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

add option to disable replacement of alert funcions #314

Closed koichirok closed 4 years ago

koichirok commented 4 years ago

Summary

Add option to disable replaceAlertMethod so that selenese-runner-java can be used even on sites where replaceAlertMethod does not work properly.

Description

I'm facing an issue where an alert dialog related command fails at one unpublished site.

On this site, JSON.parse failed to convert stringified array back to an array object due to the strange behavior of the JSON.stringify that array always seems to be converted into string twice (For example, an empty array is converted to a 4 character string "[]" and JSON.parse convert it as 2 character string [])

I tried replacing the implementation of JSON.stringify with another one, but array was still converted incorrectly.

Even for such a case, we can handle the alert dialogs using the *NativeAlert commands as long as we don't replace the alert functions.

This PR adds an option for that.

vmi commented 4 years ago

Thank you for PR!