【发布时间】:2018-09-17 12:21:54
【问题描述】:
我正在使用量角器版本 5.2.2。 , geckodriver-v0.21.0 和 Firefox 浏览器版本 61。当我尝试在 Firefox 浏览器中运行量角器脚本时,它显示错误为
"WebDriverError:Element <input id="logo" class="frx-input-file" name="logo"
type="file">is not reachable by keyboard.
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:
32:19.891Z'
System info: host: 'CS-COK-DEV-039', os.name: 'Windows 8.1', os.arch:
'amd64', os.version: '6.3', java.version: '1.8.0_60'
Driver info: driver.version: unknown".
量角器码是
var path = require('path');
var fileToUpload = "F://images/f2.jpg";
var absolutePath = path.resolve(__dirname, fileToUpload);
element(by.css('.frx-form-section-container .frx-client-logo-field .frx-input-file')).sendKeys(absolutePath);
UI代码是
<div _ngcontent-c6="" class="frx-form-input-field-container frx-client-logo-
field">
<label _ngcontent-c6="" class="frx-input-file-label" for="logo">Upload
logo</label>
<br _ngcontent-c6="">
<span _ngcontent-c6="" class="frx-input-file-caption" for="logo">Will be
used on the templates and letters</span>
<input _ngcontent-c6="" accept=".jpg, .jpeg, .gif .JPG, .JPEG, .GIF, .BMP
,.bmp" class="frx-input-file" id="logo" multiple="false" name="logo"
type="file">
</div>
相同的量角器脚本在 chrome 和 IE 浏览器中都成功运行。我们如何在 Firefox 中解决此问题。提前致谢
【问题讨论】:
标签: protractor