Search in sources :

Example 6 with VerificationException

use of com.axway.ats.uiengine.exceptions.VerificationException in project ats-framework by Axway.

the class HiddenHtmlAlert method clickOk.

@Override
@PublicAtsApi
public void clickOk(final String expectedAlertText) {
    isProcessed = false;
    webClient.setAlertHandler(new AlertHandler() {

        @Override
        public void handleAlert(Page alertPage, String alertText) {
            isProcessed = true;
            if (!alertText.equals(expectedAlertText)) {
                throw new VerificationException("The expected alert message was: '" + expectedAlertText + "', but actually it is: '" + alertText + "'");
            }
        }
    });
}
Also used : VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) Page(com.gargoylesoftware.htmlunit.Page) AlertHandler(com.gargoylesoftware.htmlunit.AlertHandler) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 7 with VerificationException

use of com.axway.ats.uiengine.exceptions.VerificationException in project ats-framework by Axway.

the class SwingTable method clickHeader.

/**
 * Click table header by column name
 *
 * @param columnName the column name
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void clickHeader(String columnName) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    JTableHeaderFixture tableHeaderFixture = tableFixture.tableHeader();
    try {
        tableHeaderFixture.clickColumn(columnName);
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) JTableHeaderFixture(org.fest.swing.fixture.JTableHeaderFixture) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) VerifyEqualityException(com.axway.ats.uiengine.exceptions.VerifyEqualityException) VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) NotSupportedOperationException(com.axway.ats.uiengine.exceptions.NotSupportedOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 8 with VerificationException

use of com.axway.ats.uiengine.exceptions.VerificationException in project ats-framework by Axway.

the class SwingTable method clickHeader.

/**
 * Click table header by column index
 *
 * @param columnIndex the column index
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void clickHeader(int columnIndex) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    JTableHeaderFixture tableHeaderFixture = tableFixture.tableHeader();
    try {
        tableHeaderFixture.clickColumn(columnIndex);
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) JTableHeaderFixture(org.fest.swing.fixture.JTableHeaderFixture) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) VerifyEqualityException(com.axway.ats.uiengine.exceptions.VerifyEqualityException) VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) NotSupportedOperationException(com.axway.ats.uiengine.exceptions.NotSupportedOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 9 with VerificationException

use of com.axway.ats.uiengine.exceptions.VerificationException in project ats-framework by Axway.

the class SwingTable method doubleClickCell.

/**
 * Double click table cell
 *
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the element doesn't exist
 */
@PublicAtsApi
public void doubleClickCell(int row, int column) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {
        tableFixture.cell(new TableCell(row, column) {
        }).doubleClick();
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) VerifyEqualityException(com.axway.ats.uiengine.exceptions.VerifyEqualityException) VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) NotSupportedOperationException(com.axway.ats.uiengine.exceptions.NotSupportedOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 10 with VerificationException

use of com.axway.ats.uiengine.exceptions.VerificationException in project ats-framework by Axway.

the class SwingTable method clickCell.

/**
 * Click table cell
 *
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void clickCell(int row, int column) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {
        tableFixture.cell(new TableCell(row, column) {
        }).click();
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) VerifyEqualityException(com.axway.ats.uiengine.exceptions.VerifyEqualityException) VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) NotSupportedOperationException(com.axway.ats.uiengine.exceptions.NotSupportedOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)18 PublicAtsApi (com.axway.ats.common.PublicAtsApi)17 UiElementException (com.axway.ats.uiengine.exceptions.UiElementException)12 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)12 NotSupportedOperationException (com.axway.ats.uiengine.exceptions.NotSupportedOperationException)10 VerifyEqualityException (com.axway.ats.uiengine.exceptions.VerifyEqualityException)10 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)10 JTableFixture (org.fest.swing.fixture.JTableFixture)10 TableCell (org.fest.swing.data.TableCell)6 Page (com.gargoylesoftware.htmlunit.Page)4 ConfirmHandler (com.gargoylesoftware.htmlunit.ConfirmHandler)2 JTabbedPaneFixture (org.fest.swing.fixture.JTabbedPaneFixture)2 JTableHeaderFixture (org.fest.swing.fixture.JTableHeaderFixture)2 UiElementProperties (com.axway.ats.uiengine.elements.UiElementProperties)1 RealHtmlAlert (com.axway.ats.uiengine.elements.html.realbrowser.RealHtmlAlert)1 RealHtmlConfirm (com.axway.ats.uiengine.elements.html.realbrowser.RealHtmlConfirm)1 RealHtmlPrompt (com.axway.ats.uiengine.elements.html.realbrowser.RealHtmlPrompt)1 MobileOperationException (com.axway.ats.uiengine.exceptions.MobileOperationException)1 ExpectedAlert (com.axway.ats.uiengine.internal.realbrowser.ExpectedAlert)1 ExpectedConfirm (com.axway.ats.uiengine.internal.realbrowser.ExpectedConfirm)1