[英]Error when trying to set text_field using watir-webdriver and chrome
我使用的是紅寶石和watir-webdriver黃瓜。 我之前沒有這個問題,其他頁面上的text_fields也可以正常工作。 我試過使用CSS和名稱代替ID,但沒有運氣。 是否有人對導致此問題的原因以及如何在Chrome中解決問題有任何想法?
使用Firefox時不會發生此錯誤。
腳本:
@session.text_field(:id, 'officialTitle').when_present.set("Test 1")
的HTML:
<input id="officialTitle" name="official_title" server-validation="" class="form-control ng-pristine ng-invalid ng-invalid-required ng-touched" ng-model="profile.study.official_title" required="" type="text">
錯誤:
Selenium::WebDriver::Error::UnknownError: unknown error: a.tagName.toUpperCase is not a function
(Session info: chrome=46.0.2490.80)
(Driver info: chromedriver=2.17.340128
(994135a3538dd99439ef22cea8a9b098e00d8eb4),platform=Mac OS X 10.11.0 x86_64)
導致另一個ID為tagName的元素引起了該問題,即使該元素未與之交互。 更改該ID可解決我的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.