当前位置: 首页>>代码示例>>Java>>正文


Java WebElement.isEnabled方法代码示例

本文整理汇总了Java中org.openqa.selenium.WebElement.isEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java WebElement.isEnabled方法的具体用法?Java WebElement.isEnabled怎么用?Java WebElement.isEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openqa.selenium.WebElement的用法示例。


在下文中一共展示了WebElement.isEnabled方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: check

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
/**
 * Check the check box
 */
@Override
@PublicAtsApi
public void check() {

    new RealHtmlElementState(this).waitToBecomeExisting();

    WebElement checkBoxElement = RealHtmlElementLocator.findElement(this);
    if (!checkBoxElement.isEnabled()) {
        throw new UnsupportedOperationException("You may not check a disabled element."
                                                + toString());
    }
    if (!checkBoxElement.isSelected()) {
        checkBoxElement.click();
    }

    UiEngineUtilities.sleep();
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:21,代码来源:RealHtmlCheckBox.java

示例2: unCheck

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
/**
 * Uncheck the check box
 */
@Override
@PublicAtsApi
public void unCheck() {

    new RealHtmlElementState(this).waitToBecomeExisting();

    WebElement checkBoxElement = RealHtmlElementLocator.findElement(this);
    if (!checkBoxElement.isEnabled()) {
        throw new UnsupportedOperationException("You may not uncheck a disabled element."
                                                + toString());
    }
    if (checkBoxElement.isSelected()) {
        checkBoxElement.click();
    }

    UiEngineUtilities.sleep();
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:21,代码来源:RealHtmlCheckBox.java

示例3: run

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
@Override
public void run() {

    super.run();

    By locator = this.readLocatorArgument("locator");

    this.waitForAsyncCallsToFinish();

    WebElement element = this.getElement(locator);
    if (!element.isEnabled()) {
        throw new RuntimeException(String.format(
                "Assertion failed: element %s was not enabled",
                locator));
    }
}
 
开发者ID:mcdcorp,项目名称:opentest,代码行数:17,代码来源:AssertElementEnabled.java

示例4: run

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
@Override
public void run() {

    super.run();

    By locator = this.readLocatorArgument("locator");

    this.waitForAsyncCallsToFinish();

    WebElement element = this.getElement(locator);
    if (element.isEnabled()) {
        throw new RuntimeException(String.format(
                "Assertion failed: element %s was not disabled",
                locator));
    }
}
 
开发者ID:mcdcorp,项目名称:opentest,代码行数:17,代码来源:AssertElementDisabled.java

示例5: isElementExist

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
/**
 * 判断元素是否存在
 *
 * @param webElement
 * @return
 */
public boolean isElementExist(WebElement webElement) {
    try {
        webElement.isEnabled();
        return true;
    } catch (NoSuchElementException e) {
        return false;
    }
}
 
开发者ID:ychaoyang,项目名称:autotest,代码行数:15,代码来源:WebTestBase.java

示例6: select

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
/**
 * set the selected value
 *
 * @param value the value to select(this is the 'value' attribute of the radio button)
 */
@PublicAtsApi
public void select(
                    String value ) {

    new RealHtmlElementState(this).waitToBecomeExisting();

    WebElement element = RealHtmlElementLocator.findElement(this, "[@value='" + value + "']", true);
    if (!element.isEnabled()) {
        throw new UnsupportedOperationException("You may not select a disabled element." + toString());
    }
    element.click();

    UiEngineUtilities.sleep();
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:20,代码来源:RealHtmlRadioList.java

示例7: waitForButton

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
private WebElement waitForButton(WebElementFacade buttonFacade) {
    WebElement button = buttonFacade.withTimeoutOf(10, TimeUnit.SECONDS).waitUntilEnabled();

    if (!button.isEnabled()) {
        button = buttonFacade.withTimeoutOf(10, TimeUnit.SECONDS).waitUntilEnabled().waitUntilVisible();
    }

    return button;
}
 
开发者ID:Comcast,项目名称:redirector,代码行数:10,代码来源:DistributionPage.java

示例8: webButtonClick

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
/**
 * Web button click.
 *
 * @param driver the driver
 * @param logger the logger
 * @param element the element
 */
public static void webButtonClick(WebDriver driver, ExtentTest logger, WebElement element) {
	try {
		if (element != null && element.isEnabled()) {
			element.click();
		}
	} catch (Exception e) {
		}
}
 
开发者ID:anilpandeykiet,项目名称:POM_HYBRID_FRAMEOWRK,代码行数:16,代码来源:WebButton.java

示例9: isWebInputEditable

import org.openqa.selenium.WebElement; //导入方法依赖的package包/类
/**
 * Checks if is web input editable.
 *
 * @param element
 *            the element
 * @return true, if is web input editable
 */
public static boolean isWebInputEditable(WebElement element) {
	boolean visibilityStatus = false;
	try {
		if (element != null) {
			visibilityStatus = element.isEnabled();
		}
	} catch (Exception e) {
		// nothing can be done at this point
	}
	return visibilityStatus;
}
 
开发者ID:anilpandeykiet,项目名称:POM_HYBRID_FRAMEOWRK,代码行数:19,代码来源:WebTextbox.java


注:本文中的org.openqa.selenium.WebElement.isEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。