Reputation: 23
I have tried the below script.. but no luck..
var Import = WDS.browser.findElement(pkg.By.xpath('//input[@id=\'fileUpload\']')); Import.click(); Import.sendKeys(['D:\Spreadsheets\WL_SpreadsheetImport.xlsx']);
Error Log: 2020-05-14 14:57:29,740 ERROR c.g.j.p.w.s.WebDriverSampler: invalid argument (Session info: chrome=81.0.4044.138)
Upvotes: 0
Views: 1013
Reputation: 168042
Import.click();
otherwise system modal file upload dialog will open and it is not controllable by SeleniumYou need to escape the backslash with another backslash like:
Import.sendKeys(['D:\\Spreadsheets\\WL_SpreadsheetImport.xlsx']);
or just use single forward slashes:
Import.sendKeys(['D:/Spreadsheets/WL_SpreadsheetImport.xlsx']);
More information:
Upvotes: 1