Open whimboo opened 6 years ago
I don’t think I understand this bug.
Get Alert Text says:
Let message be the text message associated with the current user prompt, or otherwise be null.
Send Alert Text says:
Perform user agent dependent steps to set the value of current user prompt’s text field to text.
Is the problem that the first talks about “text message” and the latter about “text field”?
Well, it's not only the wording here, but both methods really rely on different elements. While you can enter text with Send Alert Text
, you really get the message of the alert as response for Get Alert Text
. It's not only the wording, but a behavior which seem to exist for a while?
What do you mean by “different elements”?
Please see: https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt
Which says:
message
is a string of text to display to the user. This parameter is optional and can be omitted if there is nothing to show in the prompt window.
And this is different from the content of the textbox, which is visible for some alerts like the prompt
, and is handled as result
of the alert:
result
is a string containing the text entered by the user, or null.
In the WebDriver spec the endpoint for
/session/{session id}/alert/text
references different elements for the GET and POST request. While GET returns the value of the alert message, POST sets the text field of an alert.https://w3c.github.io/webdriver/webdriver-spec.html#get-alert-text https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text