Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

“value” is out of range error while calling ElementFinder.sendKeys() #5296

Closed
scottfwalter opened this issue Aug 8, 2019 · 2 comments
Closed

Comments

@scottfwalter
Copy link

Using Node 10.16.0 and Protractor 5.4.2 this code

var fileToUpload = '../tests/protractor/import-files/' + fileName;
var absolutePath = path.resolve(__dirname, fileToUpload);
//absolutePath = '/Users/scottwalter/cxone/webapp-wfm-scheduling/tests/protractor/import-files/import_staffingPlan_good.csv';
element(by.css('input[type="file"]')).sendKeys(absolutePath).

Throws the error

RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= -2147483648 and <= 2147483647. Received 2688297010
      at checkInt (internal/buffer.js:35:11)
      at writeU_Int32LE (internal/buffer.js:509:3)
      at Buffer.writeInt32LE (internal/buffer.js:678:10)
      at Object.entryHeaderToBinary (/Users/scottwalter/cxone/webapp-wfm-scheduling/node_modules/adm-zip/headers/entryHeader.js:216:18)
      at Object.packHeader (/Users/scottwalter/cxone/webapp-wfm-scheduling/node_modules/adm-zip/zipEntry.js:200:39)
      at /Users/scottwalter/cxone/webapp-wfm-scheduling/node_modules/adm-zip/zipFile.js:198:41
      at Array.forEach (<anonymous>)
      at Object.compressToBuffer (/Users/scottwalter/cxone/webapp-wfm-scheduling/node_modules/adm-zip/zipFile.js:182:23)
      at Object.toBuffer (/Users/scottwalter/cxone/webapp-wfm-scheduling/node_modules/adm-zip/adm-zip.js:401:25)
      at /Users/scottwalter/cxone/webapp-wfm-scheduling/node_modules/selenium-webdriver/remote/index.js:351:35
  From: Task: WebElement.sendKeys()
@imaynotbereal
Copy link

I am experiencing the same issue with Node 10.15.3 and Protractor 5.12. Protractor 5.1.2 depends on selenium-webdriver - 3.0.1 which in turn depends on adm-zip 0.4.4
Now adm-zip has fixed this issue in 0.4.11 under
cthackers/adm-zip#218

Protractor 5.4.2 depends on selenium-webdriver 3.6.0 which now uses jszip instead of adm-zip.
I am not quite sure why the calls above are going to adm-zip instead of jszip

@scottfwalter
Copy link
Author

My bad. We had both Protractor 5.4.2 and selenium-webdriver 2.47.0 listed as dependencies. When I updated to selenium-webdriver to 3.6.0 npm downloaded the correct version of adm-zip

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

No branches or pull requests

2 participants