[英]How to emulate clicking on an AjaxButton in the wicket's test?
我的测试中有以下代码:
AjaxButton button = (AjaxButton) getTester().getComponentFromLastRenderedPage(path);
Assert.assertNotNull(button);
getTester().clickLink(button); // fails with exception "is not an instance of AbstractLink or IAjaxLink"
我应该在最后一行写什么来强制 WicketTester 按下 AjaxButton?
使用“executeAjaxEvent”:
tester.executeAjaxEvent(button, "click");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.