Not able to switch to iframe using Selenium webdriver
<p>I am trying to click on SIGN IN link which is placed inside the iframe with class attribute "modalIframe". I have been trying for the past two days to find a solution for this but not able to. Any help would be really appreciated.</p>

<p>Code as below</p>

<pre><code>public class Datereader
{

    public static void main(String[] args)
    {
        System.setProperty("webdriver.gecko.driver","C:\\Users\\Madankumar\\Desktop\\Gecko Driver\\geckodriver.exe");
        WebDriver driver=new FirefoxDriver();
        driver.get("https://www.redbus.in/");
        driver.manage().window().maximize();
        driver.findElement(By.xpath(".//div[@class='icon-down icon ich dib']")).click();
        driver.findElement(By.id("signInLink")).click();    
        driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
        WebElement iframeElement=driver.findElement(By.xpath("//*[@class='modalIframe']"));
        driver.switchTo().frame(iframeElement);
        driver.findElement(By.linkText("sign in")).click();


    }
}
</code></pre>

<p>On running the code I am getting below error:</p>

<blockquote>
  <p>JavaScript warning: <a href="https://cdn-jp.gsecondscreen.com/static/tac.min.js" rel="nofollow noreferrer">https://cdn-jp.gsecondscreen.com/static/tac.min.js</a>, line 3: unreachable code after return statement</p>
</blockquote>