Skip to content Skip to sidebar Skip to footer

Aria-hidden Span/button Prevents From Fetching Element - Selenium

I am trying to click a calendar from the following website using Selenium with Java (3.3.0 and java version '1.8.0_66'). https://www.cathaypacific.com/cx/en_US.html Target to be cl

Solution 1:

In order to reach to the required control, you can make use of its container. Hence, try following:

//div[@data-date-picker-id='book-trip']//button[starts-with(@id,'dp') and starts-with(@aria-label, 'Departing on ')]

Let me know, whether it works for you.

Solution 2:

Try this for the button's xpath -

//div[@class = 'dates-picker-wrapper splited-date-picker flight-datepicker']/div[1]/button

I have checked this in Firefox and it working for me.

Solution 3:

Try this JavaScript code to enable visibility of selected element.

WebElementelement= driver.findElement(By.xpath("Element Xpath"));
Stringjs="arguments[0].style.height='auto'; arguments[0].style.visibility='visible';";
((JavascriptExecutor) driver).executeScript(js, elem);

Post a Comment for "Aria-hidden Span/button Prevents From Fetching Element - Selenium"