1

我正在运行一个jsf单元测试,它包括测试是否显示模态,我想测试模态内部的一些动作,但isDisplayed总是错误的。

有什么我在这里想念的吗。

这是我的一段代码:

 HtmlSelect mSelection = (HtmlSelect) client.getElement("selecID");
        assertTrue( mSelection.isDisplayed() );
        assertFalse( mSelection.isDisabled() );

        HtmlOption mOption = mOption .getOptionByValue("18");
        mOption .setSelected(true);
        try {
            mOption .click();
        } catch (IOException e2) {
            e2.printStackTrace();
        }

        System.out.println(" SELECTED = " + mOption .getText());        
         HtmlButtonInput goButton = (HtmlButtonInput) client.getElement("goButton");
        assertTrue( goButton.isDisplayed() );
        assertFalse( goButton.isDisabled() );
        try {
            goButton.click();

        } catch (IOException e) {
        }

        try {
            Thread.sleep(10000);

        } catch (InterruptedException e1) {    
            e1.printStackTrace();
        }

            //This part is inside the modal
        HtmlSelect mmSetSelection = (HtmlSelect) client.getElement("mmSelection");
        assertTrue( mmSetSelection!= null );

        System.out.println(" IS DIAPLED? = " + mmSetSelection.isDisplayed() );
4

0 回答 0