How to click yatra.com Sign In button?

Answered

Hello I am new to selenium, I m trying to signin into yatra.com sign in page, but its showing an exception as “Exception in thread “main” org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
Command duration or timeout: 46 milliseconds”.
This is my code:
WebDriver driver=new FirefoxDriver();
driver.get(“http://www.yatra.com/”);
driver.findElement(By.xpath(“.//*[@id=’signinPanel’]/input”)).click();
driver.findElement(By.xpath(“.//*[@id=’emailId’]”)).sendKeys(“Valid Mail Id”);
driver.findElement(By.xpath(“.//*[@id=’password’]”)).sendKeys(“Valid Password”);
driver.findElement(By.xpath(“.//*[@id=’signInBtn’]”)).click();

Please help to solve this exception.

Thanks & Regards
Samba.

samba Train Asked on December 11, 2014 in Selenium WebDriver.

That sign in link may present in frame ,so only its not clicking it seems…check once whether that link is present in frame…if so use code
Driver.switchto.Frame(webElelment argued)
Next click on it..I m guessing ,so try once.
Let me know whether it worked or not n all

on December 11, 2014.

Hi Pradeep,
The element is not inside frame & it is hidden so I am trying to click that hidden element with javascript code with the help of JavascriptExecutor, but its not executing.
Thanks&Regards
Samba.

on December 12, 2014.
Add Comment
2 Answer(s)
Best answer

Hi, I got the solution finally.


JavascriptExecutor js=(JavascriptExecutor)driver;

js.executeScript("document.getElementsByClassName('yt-btn btn-blue btn-block simulateSubmit')[0].click();");

Thanks & Regards
Samba.

samba Train Answered on December 12, 2014.

Hi samba,its pradeep here
Regarding fetching numeric data need some clarification……..
Hi samba
I want clarification regarding return type of the Readexceldata method coz as u mentioned in code value vl b different i’e numeric n string so how u decide return type fr dat method in excel library

on December 12, 2014.

Hi  Pradeep, its simple you can declare the return type of readExcelData()  is Object[][].
Thanks & Regards
Samba.

on December 13, 2014.
Add Comment

Try to maximize the page and try with it or it may happen that element is present inside any frame

som Train Answered on December 12, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.