How to click Sign In button?


Hello I am new to selenium, I m trying to signin into 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.findElement(By.xpath(“.//*[@id=’emailId’]”)).sendKeys(“Valid Mail Id”);
driver.findElement(By.xpath(“.//*[@id=’password’]”)).sendKeys(“Valid Password”);

Please help to solve this exception.

Thanks & Regards

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.

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

    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

    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

    Train Answered on December 12, 2014.
    Add Comment
  • Your Answer

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