Java tutorial
/* * Copyright 2008-2013 Microarray Informatics Team, EMBL-European Bioinformatics Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * * For further details of the Gene Expression Atlas project, including source code, * downloads and documentation, please see: * * http://gxa.github.com/gxa */ package uk.ac.ebi.atlas.acceptance.selenium.pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; import java.util.List; public class DifferentialExperimentDesignTablePage extends ExperimentDesignTablePage { public static String EXPERIMENT_ACCESSION = "E-GEOD-38400"; private static final String DEFAULT_PAGE_URI = "/gxa/experiments/" + EXPERIMENT_ACCESSION + "/experiment-design"; @FindBy(id = "selectedContrast") private WebElement contrastSelection; public DifferentialExperimentDesignTablePage(WebDriver driver) { super(driver); } public DifferentialExperimentDesignTablePage(WebDriver driver, String httpParameters) { super(driver, httpParameters); } @Override protected String getPageURI() { return DEFAULT_PAGE_URI; } public String getSelectedContrast() { Select select = new Select(contrastSelection); return select.getFirstSelectedOption().getText(); } public void selectContrast(String value) { Select select = new Select(contrastSelection); select.selectByValue(value); } public String getLineColor(int rowIndex) { List<WebElement> row = getRow(experimentDesignTable, rowIndex); WebElement element = row.get(0); return element.getCssValue("background-color"); } }