我有一个测试上传文件(代码如下)在我的应用程序,并在本地测试它完美的作品。但是,当我使用BrowserStack进行测试时,BrowserStack无法访问本地计算机中的文件。上传功能(BrowserStack使用node.js)
我检查了他们有关使用BrowserStack与Node.js的文档,但我没有看到有关上传功能的任何文档。我的问题是,我如何告诉BrowserStack访问我的本地文件?
有没有人遇到过同样的问题?
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();
});
});
};
其中jmxFilePath设置为:
this.jmxFile = process.cwd() + '/test/functional/features/data/test.jmx';
谢谢!
你解决了吗? – 2015-03-16 16:10:39
没有明显的这是不支持BrowserStack的Node.js – mdcruz 2015-03-18 09:40:16