Skip to content
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

In Firefox SendKeys a String to a Input that is validating the text in real time #2200

Open
andonima opened this issue Sep 27, 2024 · 1 comment

Comments

@andonima
Copy link

System

  • Version: 0.35.0
  • Platform: Windows
  • Firefox: Firefox 130.0.1
  • Selenium: 4.25.0 C#

Testcase

I openned the issue on selenium project and they have derivated me here.

We normally execute our e2e tests on chrome, but we want to add firefox support and we the SendKeys method is not working as expected with inputs that have validations.

The simplest example is:

We want to clear the text of an email input and then writte a new email on it. (works perfectly on Chrome)

emailInput.Clear();
emailInput.SendKeys("[email protected]");

But on the frontend we are getting:
image

My theory is that "the text stream" brokes when the element changes, because see how the input performs with human interaction. (We obviusly are using data-testid="email" to select the element. )

email.mp4

Input on error
<input data-testid="email" matinput="" type="text" name="email" class="mat-mdc-input-element ng-tns-c11-70 mat-mdc-form-field-input-control mdc-text-field__input cdk-text-field-autofill-monitored ng-dirty ng-touched ng-invalid" placeholder="E-Mail" id="mat-input-13" required="" aria-required="true" aria-invalid="true" aria-describedby="mat-mdc-error-37 mat-mdc-error-9">

Input ok
<input data-testid="email" matinput="" type="text" name="email" class="mat-mdc-input-element ng-tns-c11-8 ng-untouched ng-pristine mat-mdc-form-field-input-control mdc-text-field__input cdk-text-field-autofill-monitored ng-valid" placeholder="E-Mail" id="mat-input-6" required="" aria-required="true" aria-invalid="false">

We have a found a "dirty" workaround that is to substring the email to:

"example@c"
"ompany.c"
"om"

and doing the SendKeys 3 times.

But we have more inputs with different validation "urls, telephones etc..". and It would be a nightmare to handle them with that workaround.

Any clue?

Thanks in advance

Stacktrace

Trace-level log

@whimboo
Copy link
Collaborator

whimboo commented Sep 27, 2024

Could you please attach a trace-level log from geckodriver? Also a minimzed HTML testcase would be great. Read more about reporting actionable bugs in our contribution guidelines. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants