framework.expedia.pages.CarSearchResultComponent Maven / Gradle / Ivy
package framework.expedia.pages;
import com.github.licanhua.test.framework.Container;
import org.apache.log4j.Logger;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.util.List;
public class CarSearchResultComponent extends Container{
private static Logger logger = Logger.getLogger(CarSearchResultComponent.class.getName());
@FindBy(xpath=".//a[starts-with(@id, 'aria-option-')]")
List reserveButtons;
public void reserve(int index) {
logger.info("Search result item found " + reserveButtons.size());
for (int i=0; i index)
reserveButtons.get(index).click();
else
throw new RuntimeException("index is out of boundary, index= " + index);
}
}