I am new to Selenium WebDriver
. I am stuck in locating one element for the following input text.
HTML
code is
<input type="text" tabindex="1" size="30" name="flights_search[from_location_name]" id="flights_search_from_location_name" class="flight-from ui-autocomplete-input" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true">
<input id="flights_search_from_location" class="wego-from-code" type="hidden" name="flights_search[from_location]" value="">
Code I tried :
By ID
driver.findElement(By.id("flights_search_from_location_name")).clear();
By xpath
driver.findElement(By.xpath("/html/body/div[2]/div[1]/div[1]/form/fieldset/span[2]/input[1]")).clear();
I have tried with id
, name
, classname
and xpath
, but it is not able to locate this element.