Trying to select 2nd value from Drop down. Drop down is made up of div class.
From constants class:
public static final String HOME_PAGE_FLYING_FROM_ID = "departureAirport";
public static final String FLYING_FROM_AJAX_XPATH = "//div[contains(@class,'autocompletebox') and (rel,'departureAirport')]/p[2]/a";
from my FlightSearch class:
@FindBy(how = How.ID, using = HOME_PAGE_FLYING_FROM_ID)
WebElement flyingFrom;
@FindBy(how = How.XPATH, using = FLYING_FROM_AJAX_XPATH)
WebElement flyingFromAjaxValue;
public void simpleFlighSearch() {
flyingFrom.sendKeys("new");
action.moveToElement(flyingFromAjaxValue).click().build().perform();
LOGGER.debug("clicked`");
}
This is the error I am getting it: invalid selector: Unable to locate an element with the xpath expression. Failed to execute 'evaluate' on 'Document'.
and @rel='departureAirport'
? - buftlica