对话框上的按钮无法单击或在量角器中选择

dialog box无法在量角器中获得“启动新应用程序”按钮。该脚本没有检索“启动新应用程序”按钮的ID

it("test the modal dialog button",function() {[code for the dialog box][2]

browser.waitForAngularEnabled(false);
browser.get("URL given");


expect(element(by.cssContainingText('.ng-star-inserted','2')).isPresent()).toBeFalsy();
expect(element(by.cssContainingText('#button-primary','Back to home')).isPresent()).toBeTruthy();


element(by.buttonText('resend')).click; 
browser.wait(3000);
element(by.cssContainingText('button-primary','Back to home')).click();                 

选择启动新应用程序或单击。新页面或URL需要加载

qipaoshaonian 回答:对话框上的按钮无法单击或在量角器中选择

您在此行中忘记了括号

element(by.buttonText('resend')).click;

所以应该是

element(by.buttonText('resend')).click();

本文链接:https://www.f2er.com/3162384.html

大家都在问