Search in sources :

Example 31 with RealHtmlElementState

use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.

the class RealHtmlElement method mouseOver.

/**
     * Simulate mouse over
     */
@Override
@PublicAtsApi
public void mouseOver() {
    new RealHtmlElementState(this).waitToBecomeExisting();
    WebElement element = RealHtmlElementLocator.findElement(this);
    // 1. option
    new Actions(webDriver).moveToElement(element).perform();
    // 2. option
    //        element.sendKeys( "" );
    // 3. option
    //        Mouse mouse = ( ( HasInputDevices ) webDriver ).getMouse();
    //        mouse.mouseMove( ( ( RemoteWebElement ) element ).getCoordinates() );
    // 4. option
    //        String javaScript = "var evObj = document.createEvent('MouseEvents');"
    //                            + "evObj.initMouseEvent(\"mouseover\",true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);"
    //                            + "arguments[0].dispatchEvent(evObj);";
    //        JavascriptExecutor js = ( JavascriptExecutor ) webDriver;
    //        js.executeScript( javaScript, element );
    UiEngineUtilities.sleep();
}
Also used : RealHtmlElementState(com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 32 with RealHtmlElementState

use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.

the class RealHtmlTextArea method getValue.

/**
     * Get the Text Area value
     * @return
     */
@Override
@PublicAtsApi
public String getValue() {
    new RealHtmlElementState(this).waitToBecomeExisting();
    WebElement element = RealHtmlElementLocator.findElement(this);
    return normalizeText(element.getAttribute("value"));
}
Also used : RealHtmlElementState(com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 33 with RealHtmlElementState

use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.

the class RealHtmlTextArea method setValue.

/**
     * Set the Text Area value
     *
     * @param value
     */
@Override
@PublicAtsApi
public void setValue(String value) {
    new RealHtmlElementState(this).waitToBecomeExisting();
    WebElement element = RealHtmlElementLocator.findElement(this);
    element.clear();
    element.sendKeys(normalizeText(value));
    UiEngineUtilities.sleep();
}
Also used : RealHtmlElementState(com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 34 with RealHtmlElementState

use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.

the class RealHtmlTextBox method setValue.

/**
     * Set the Text Box value
     *
     * @param value
     */
@Override
@PublicAtsApi
public void setValue(String value) {
    new RealHtmlElementState(this).waitToBecomeExisting();
    WebElement element = RealHtmlElementLocator.findElement(this);
    element.clear();
    element.sendKeys(value);
    UiEngineUtilities.sleep();
}
Also used : RealHtmlElementState(com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState) WebElement(org.openqa.selenium.WebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

RealHtmlElementState (com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState)34 PublicAtsApi (com.axway.ats.common.PublicAtsApi)31 WebElement (org.openqa.selenium.WebElement)30 SeleniumOperationException (com.axway.ats.uiengine.exceptions.SeleniumOperationException)7 Select (org.openqa.selenium.support.ui.Select)6 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)4 Actions (org.openqa.selenium.interactions.Actions)4 RemoteWebElement (org.openqa.selenium.remote.RemoteWebElement)4 AbstractRealBrowserDriver (com.axway.ats.uiengine.AbstractRealBrowserDriver)2 NoSuchElementException (org.openqa.selenium.NoSuchElementException)2 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 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)1 VerifyEqualityException (com.axway.ats.uiengine.exceptions.VerifyEqualityException)1 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)1 ExpectedAlert (com.axway.ats.uiengine.internal.realbrowser.ExpectedAlert)1 ExpectedConfirm (com.axway.ats.uiengine.internal.realbrowser.ExpectedConfirm)1 ExpectedPrompt (com.axway.ats.uiengine.internal.realbrowser.ExpectedPrompt)1 IExpectedPopup (com.axway.ats.uiengine.internal.realbrowser.IExpectedPopup)1