我如何解决序列未在动作类量角器中定义

时间:2018-10-29 15:13:23

标签: angularjs automation protractor action sequence

COUNTY HTML我要点击的动作类如下:

var mail=element(by.xpath('//span[@class="mat-select-placeholder ng- tns- 
c44-174 ng-star-inserted"][text()="Country"]'));
browser.actions();

browser.actions.mouseMove(mail);
browser.actions.click().perform();
browser.sleep('3000');
var subMenu=element(by.xpath('//span[@class="mat-option-text"][text()="United States"]'));
subMenu.click();
browser.sleep('6000'); 

执行抛出时:

  

消息:失败:序列未定义堆栈:ReferenceError:序列未定义

感谢您的帮助。谢谢

<span class="mat-select-placeholder ng-tns-c34-236 ng-star-inserted" style="">Country</span>  

美国 us HTML html

1 个答案:

答案 0 :(得分:0)

您可以尝试以下吗?

element(by.cssContainingText('span', 'Country')).click();
browser.sleep(3000);
element(by.cssContainingText('mat-option', 'United States')).click();
browser.sleep(6000);