我有一个文本区域div字段:
<div id="shortansweractivityId" class="shortanswerText ng-pristine ng-scope ng-isolate-scope ng-invalid ng-invalid-required ng-touched" ng-model="activity.answer" ng-if="isEditable" ng-focus="editing()" placeholder="Write here..." contenteditable="true" content-type="text"></div>
我可以在chrome中使用sendKeys
:
element(by.css('div#shortansweractivityId')).sendKeys('Test');
但是当在safari中运行时它会出错:
UnknownError:undefined不是对象(评估&#39; bueval.length&#39;) (警告:服务器未提供任何堆栈跟踪信息) 命令持续时间或超时:18毫秒构建信息:版本: &#39; 2.45.0&#39;,修订版:&#39; 5017cb8&#39;,时间:&#39; 2015-02-26 23:59:50&#39;系统 info:host:&#39; spatchamatla-mac.local&#39;,ip:&#39; 10.29.1.136&#39;,os.name:&#39; Mac OS X&#39;,os.arch:&#39; x86_64&#39;,os.version:&#39; 10.10.3&#39;,java.version: &#39; 1.8.0_45&#39;驱动程序信息:org.openqa.selenium.safari.SafariDriver 功能[{browserName = safari,takeScreenshot = true, javascriptEnabled = true,version = 8.0.6,cssSelectorsEnabled = true, platform = MAC,secureSsl = true}]会话ID:null
有什么建议吗?
答案 0 :(得分:1)
使用jquery
中的browser.executeScript()
在Safari中使用。