i'm testing my JSF with Arquillian.
a simple button looks like this:
<h:form id="myForm">
<a4j:commandLink value="delete"
ajaxSingle="true" id="delete"
action="#{controller.delete(object)}"
reRender="something" status="globalStatus"
onclick="if(!confirm('do you really wanna delete this?')){return false;}" />
</h:form>
The controller-function will looks like this
delete(Object object){
do something
}
My test looks like this
@RunWith(Arquillian.class)
public class TestCategoryPage extends Browser
@Test
@RunAsClient
public void delete_test(){
browser.open(URL);
browser.click("id=myForm:cbDelete");
Assert.assertTrue("something", browser.isElementPresent("xpath=//p[contains(text(), 'deleted successfull')]"));
All other tests are working, but when i run this test i get the following exception:
com.thoughtworks.selenium.SeleniumException: ERROR: There was an unexpected Confirmation! [do you really wanna delete this?] at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:112)
Is there any way to catch this javascript confirmation? Thanks!