I have a test for uploading a file (code below) in my application and testing it locally works perfectly. However, when I test it using BrowserStack, BrowserStack cannot access the file in my local machine.
I have checked their documentation about using BrowserStack with Node.js but I haven't seen any documentation about upload functionality. My question is, how do I tell BrowserStack to access my local file?
Has anyone encountered the same issue before?
this.selectJmxFile = function(jmxFilePath, done){
this.driver.findElement(webdriver.By.xpath("//input[@type='file']")).sendKeys(jmxFilePath);
this.driver.wait(function () {
return driver.isElementPresent(webdriver.By.css('.test.files.msg.right'));
}, this.timeout).then(function () {
driver.findElement(webdriver.By.css('.test.files.msg.right')).getText().then(function(text) {
expect(text).to.equal('1 new file(s) selected');
done();
});
});
};
where jmxFilePath is set as:
this.jmxFile = process.cwd() + '/test/functional/features/data/test.jmx';
Thanks!