Calling element.sendKeys() seems to not send all the keys
See original GitHub issueI am doing the following two tests:
it("Should be able to populate the firstname field", function () {
expect(capturePageModel.findFirstNameFieldValue()).toEqual("");
capturePageModel.setFirstNameFieldValue("Adam");
expect(capturePageModel.findFirstNameFieldValue()).toEqual("Adam");
});
it("Should be able to populate the lastname field", function () {
expect(capturePageModel.findLastNameField()).toEqual("");
capturePageModel.setLastNameFieldValue("Parrish");
expect(capturePageModel.findLastNameField()).toEqual("Parrish")
});
When I execute both tests in the same describe
block I definitely am seeing the second test only send the “sh” value of the “Parrish” value I am passing in. Thus the test fails.
However each test runs fine by itself. I am attempting to use PageObjects to write a few documents on how this could work but curious if you have seen anything like this happen.
Simple example of my setter and getter functions in my PageObjects
this.setLastNameFieldValue = function( value ) {
var lastNameElement = element(by.model('presubmitUser.lastName'))
lastNameElement.sendKeys( value );
}
this.findLastNameField = function() {
var firstNameElement = element(by.id('lastName'))
return firstNameElement.getAttribute('value');
}
The first name field is identical to the last name field.
Issue Analytics
- State:
- Created 9 years ago
- Comments:56 (14 by maintainers)
Top Results From Across the Web
'sendKeys' are not working in Selenium WebDriver
Try clicking on the textbox before you send keys. It may be that you need to trigger an event on the field before...
Read more >1771 - sendKeys() sometimes doesn't enter all the characters ...
Hi, Since upgrading to chrome driver 2.35 sendKeys() method is sending jumbled text to the text box which affecting our automation suite.
Read more >sendKeys() not working in Selenium Webdriver - Tutorialspoint
If we encounter issues while working with the sendKeys method, then we can use the JavaScript Executor to input text within an edit...
Read more >Selenium SendKeys : All You Need To Know - LambdaTest
In this article, we'll delve into how Selenium helps us pass values to text fields using the Selenium sendKeys() method.
Read more >7. WebDriver API — Selenium Python Bindings 2 documentation
This can be caused by calling an operation on the Alert() class when an alert is ... Values are defined in Keys class....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
another workaround: pass individual chars to sendKeys:
'blah'.split('').forEach((c) => element.sendKeys(c))
We also only have this issue on jenkins and not locally…