1

I started to learn SeleniumWeb driver with Java and I write some code like this :

package firstPackage;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class firstScript {   
    public static void main(String[] args) {
        // declaration and instantiation of objects/variables
        System.setProperty("webdriver.firefox.marionette","C:\\geckodriver.exe");
                WebDriver driver = new FirefoxDriver();
                driver.get("http//:www.google.com");
                WebElement element = driver.findElement(By.name("q"));
                element.sendKeys("mysql excel 2013");
                element.submit();
    }  
 }

If I run this code, mozilla only start, It is not contiune. I want to it to "google" and search "mysql excell 2013". How can I do?

1 Answers1

-1

I am using the selenium-server-standalone-3.5.3.jar in which this code is not working but when I changed jar from 3.5.3 to 2.44.0 then Its working fine.

Its opening the firefox and search the "mysql excel 2013" and got the results of it.

So you need to change the selenium version or need to change the browser from firefox to chrome.

Hiten
  • 724
  • 1
  • 8
  • 23