All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sdl.selenium.extjs6.button.ToggleButton Maven / Gradle / Ivy

Go to download

Automated Acceptance Testing. Selenium and Selenium WebDriver test framework for web applications. (optimized for dynamic html, ExtJS, Bootstrap, complex UI, simple web applications/sites)

The newest version!
package com.sdl.selenium.extjs6.button;

import com.sdl.selenium.web.SearchType;
import com.sdl.selenium.web.WebLocator;

public class ToggleButton extends Button {

    public ToggleButton() {
        super();
        setClassName("ToggleButton");
    }

    public ToggleButton(WebLocator container) {
        super(container);
    }

    public ToggleButton(WebLocator container, String text, SearchType... searchTypes) {
        super(container, text, searchTypes);
    }

    public boolean press(boolean press){
        return press == isPressed() || click() && (press == isPressed());
    }

    public boolean isPressed(){
        String aClass = getAttributeClass();
        return aClass != null && aClass.contains("x-btn-pressed");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy