我的問題是,當我嘗試使用CKEditor將數據設置爲字段時,我收到了量角器中的「元素不可見」消息。 應用程序正在與AngularJS合作。如何使用CKEditor在量角器測試中將數據設置爲現場?
element(by.model("question.translations[lang.locale].answer")).sendKeys("Test answer e2e!!!");
如何在量角器測試中將CKEditor設置(或獲取)數據到現場? HTML代碼:
<div ng-repeat="lang in languages">
<div class="col-md-4">
<div class="input-icon right">
<div ckeditor="CKoptions" ng-model="question.translations[lang.locale].answer"></div>
</div>
</div>
</div>
當我嘗試這個
var value = 'Hello';
browser.executeScript(function (arguments) {
window.CKEDITOR.instances.html_editor.setData(arguments[0]);
}, value);
我得到的錯誤:失敗:未知的錯誤:無法讀取屬性 '使用setData'未定義的
當我試圖在上面的代碼中,我得到了錯誤: 不止一個元素中找到for locator by.model(「question.translations [lang.locale] .question」) - 將使用第一個結果 失敗:輸入字段不可見 等待8066ms後超時 – Shol
@Shol,只需更新上述代碼中的定位器值即可。或粘貼HTML我可以告訴你該輸入文件元素的定位器。 –
我已經添加了html代碼。我如何更新定位器? – Shol