add option to disable replacement of alert funcions #314
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.