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

com.sdl.selenium.extjs6.button.SegmentedButton 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.WebLocator;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

@Slf4j
public class SegmentedButton extends WebLocator {

    public SegmentedButton() {
        setClassName("SegmentedButton");
        setBaseCls("x-segmented-button");
    }

    public SegmentedButton(WebLocator container) {
        this();
        setContainer(container);
    }

    public List getButtons() {
        List buttons = new ArrayList<>();
        Button button = new Button(this).setClasses("x-segmented-button-item");
        int size = button.size();
        for (int i = 1; i <= size; i++) {
            button.setResultIdx(i);
            String text = button.getText();
            buttons.add(text);
        }
        return buttons;
    }

    public boolean press(String name) {
        ToggleButton button = new ToggleButton(this, name).setClasses("x-segmented-button-item");
        return button.press(true);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy