Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to open Firefox browser with given URL - Selenium Webdriver & Java

I have written the following selenium script which opens Gmail website.

import org.openqa.selenium.WebDriver; <br>
import org.openqa.selenium.firefox.*;

public class OpenGmail {

    /**
     * @param args
     */
    public void OpenGmailApp()
    {
        WebDriver webdriver = new FirefoxDriver();
        webdriver.get("gmail URL");
    }
    public static void main(String[] args) {
        OpenGmail ob = new OpenGmail();
        ob.OpenGmailApp();
    }
}

When I execute the above script, I'm getting Firefox home page only. Its not gmail login page. Kindly guide what could be the error I made in that script.

like image 658
Karunagara Avatar asked Sep 27 '26 02:09

Karunagara


1 Answers

If your jar files are old and the browser was updated to latest version, then download the latest jar files from selenium website -

Selenium Download

You can also use the Selenium FF addon..

FF Selenium Addon

All the steps can be recorded in the addon and the script can be exported.

like image 165
Arsalan Avatar answered Sep 29 '26 17:09

Arsalan