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.
Summary
Add option to disable
replaceAlertMethod
so that selenese-runner-java can be used even on sites wherereplaceAlertMethod
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 theJSON.stringify
that array always seems to be converted into string twice (For example, an empty array is converted to a 4 character string"[]"
andJSON.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.