New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updateValue is appending instead of replacing the value of an input field #4026
Comments
Does it only append in Chrome or does it append in Firefox as well? |
I haven't tried Firefox.
…-- Chris Jackson
On Fri, Feb 16, 2024 at 9:48 AM Priyansh Garg ***@***.***> wrote:
Does it only append in Chrome or does it append in Firefox as well?
—
Reply to this email directly, view it on GitHub
<#4026 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2UI262GQ3SM5UBWHNPXMTYT6LVXAVCNFSM6AAAAABDMK2MA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBYHE3TONBWG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
browser.clearValue isn't clearing the value, either. I had to write the following code to clear the input:
That code works to clear the input, but not |
I tried this on Firefox and the This bug seems to be only present in Chromium-based browsers (Chrome, Edge, etc.) where the clear command is not able to reset the value of input fields and still return a 200 response code, and it needs to be fixed by browser vendors only. Moreover, it seems to be happening in React applications mostly. But if the issue is not fixed by the browser vendors sooner, maybe we could add a fallback to the cc: @AutomatedTester Edit: The issue seems to be present in Safari browser as well. |
Thank you for investigating. I'm not sure what the proper course of action
is. If `updateValue` or `clearValue` aren't working as expected, they
should fail with an error message explaining how to workaround the issue.
Otherwise, test writers are going to waste a ton of time trying to figure
out what went wrong.
…-- Chris Jackson
On Tue, Feb 20, 2024 at 12:40 AM Priyansh Garg ***@***.***> wrote:
I tried this on Firefox and the updateValue command is working fine over
there.
This bug seems to be only present in Chromium-based browsers (Chrome,
Edge, etc.) where the clear command is not able to reset the value of input
fields and still return a 200 response code, and it needs to be fixed by
browser vendors only. Moreover, it seems to be happening in React
applications mostly.
But if the issue is not fixed by the browser vendors sooner, maybe we
could add a fallback to the clearValue command in Nightwatch where if the
input field contains a value even after the completion of the clearValue
command, Nightwatch would fall back to the workaround suggested by you.
cc: @AutomatedTester <https://github.com/AutomatedTester>
—
Reply to this email directly, view it on GitHub
<#4026 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2UI2ZVPYFSL5Q5YK6WC5DYUROOVAVCNFSM6AAAAABDMK2MA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJTG4YTSNJXGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
You're absolutely right. But how Nightwatch works is when you execute the In this case, the webdriver server is sending back a 200 response code even when the input field isn't actually cleared, and so, because of the 200 response code, Nightwatch assumes that the webdriver must have completed its task and moves on. The next course of action here (on our side) would be to narrow down the issue further (to find out what's actually causing it) and then raise it with the Chrome/Safari team. But since that might take long, I think it'd be better to add a fallback in the |
I'll trust your judgement. Thank you for investigating this. And I
appreciate your quick response.
…-- Chris Jackson
On Wed, Feb 21, 2024 at 2:15 AM Priyansh Garg ***@***.***> wrote:
You're absolutely right. But how Nightwatch works is when you execute the
clearValue command it sends an HTTP request to the webdriver server
(chromedriver, geckodriver, etc.) to clear the field and the webdriver
sends back a response based on whether the task was successfully completed
or not.
In this case, the webdriver server is sending back a 200 response code
even when the input field isn't actually cleared, and so, because of the
200 response code, Nightwatch assumes that the webdriver must have
completed its task and moves on.
The next course of action here (on our side) would be to narrow down the
issue further (to find out what's actually causing it) and then raise it
with the Chrome/Safari team.
But since that might take long, I think it'd be better to add a fallback
in the clearValue command in Nightwatch to handle such cases. I'll raise
a new issue for that shortly.
—
Reply to this email directly, view it on GitHub
<#4026 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2UI27VSZHCF2VCHZ5ALMDYUXCMNAVCNFSM6AAAAABDMK2MA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJWGMYTKNBWGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This should ideally be resolved in the latest release of Nightwatch ( |
Description of the bug/issue
I'm using
updateValue
to edit a form that already has values in the input fields. However,updateValue
is only appending text instead of replacing the text.Steps to reproduce
npx nightwatch -e chrome test/bills/editBill.ts
Sample test
Command to run
Verbose Output
Nightwatch Configuration
Nightwatch.js Version
3.4.1
Node Version
v18.19.0
Browser
Version 121.0.6167.139 (Official Build) (x86_64)
Operating System
macOS Sonoma 14.2.1 (23C71)
Additional Information
No response
The text was updated successfully, but these errors were encountered: