Closed djom202 closed 2 years ago
Wrote my workaround for this:
// BUG: https://github.com/SeleniumHQ/selenium/issues/6343
// Cannot send long strings
if (text.length >= 250) {
const chunks = options.message.match(/.{1,250}/g)
await Promise.all(
chunks.map(async chunk => {
await browser.sleep(100)
await $('input').sendKeys(chunk)
})
)
} else {
await this.chatMessageTextArea.sendKeys(text)
}
@Xotabu4 Looks great, let me implement it, but I think is going to work fine. Thanks.
It's not clear as for some cases with a lot of line breaks - 250 chars limit is not enough
@barancev @JS31096 seems like you can close this issue, i cannot reproduce
I am getting an ENAMETOOLONG error for .sendKeys() with long messages on selenium 4 using docker
@mrkjdy can yo provide an example of the string ?
Here's the error output that I get:
- Failed: ENAMETOOLONG: name too long, stat 'long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample - long text sample'
From: Task: WebElement.sendKeys()
at WebElement.sendKeys (/Users/markjudy/Desktop/e2e-test/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:2185:43)
Also, it only happens if I have a FileDetector set
Right, when you have a file detector set, it's first going to try to parse the string to see if it is a file, and since file length is limited to 255 the OS library is throwing an error.
Maybe it would make sense to add a conditional to check if the size is >255 and treat it as if there were no file detector...
Anyone want to make a PR right around here: https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/lib/webdriver.js#L2533
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Meta
OS: OSX 10.13.6
Selenium Version: 2.53.2
Browser: Chrome
Browser Version: v68.0.3 (64-bit)
Command
The text is generated randomly by chancejs
Expected Behavior
The string is input into a textarea in Chrome v68 on OSX without any issues.
Actual Behavior
sendKeys throws ENAMETOOLONG if the string is input all at once. It seems as if the textarea in the OSX Chrome webdriver is being treated like an input of type=text.
Steps to reproduce
Using nodejs generate a large string (>300 chars) s and call .sendKeys(s) on a textarea or input
This testcase triggers the failure on my local machine and on BrowserStack.
Issue related by #2164
Error description