我对 protactor 很陌生,我正在运行一个测试用例,我必须在其中单击一些东西。但是,我一直遇到问题。
我要点击class = portal_element_image
describe 'Editor Changes', ->
it 'Remove Image, Add terms and save', ->
browser.actions().mouseMove($('.portal_element_image')).click(); //This is where it fails :-(
#wait for the slide down to
expect(driver.wait ( ->
return driver.getCurrentUrl().then (url) ->
return /demo/.test(url)
), timeout).toBeTruthy()
基本上没有任何反应,只是超时了。我想点击一个特定的类。
这是我的结构。
<div>
<ol>
<li>
<div id="something" class="portal_element_image">
<span> logo</span>
</div>
</li>
</ol>
</div>
谁能告诉我我做错了什么?
谢谢
最佳答案
element(by.id("something")).click();
(或)
element(by.css(".portal_element_image")).click();
关于javascript - Protractor 点击问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31795963/