1

My code is

package mentor.qa.selenium; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; public class WDDemo1 { public static void main( String[] args){ WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com"); } } 

I am using the latest java jar file 2.47.1 and Firefox 41.0.1. It starts Firefox but does not go to the link. How can I solve that?

6
  • Do you have any additional error messages, stacktraces or logs? Commented Oct 5, 2015 at 6:35
  • In problems have 5 warnings. Build path specifies execution environment javaSE-1.7. There are no JREs installed in the workspace that are strictly compatible with this environment. Commented Oct 5, 2015 at 6:41
  • Possible duplicate of Selenium WebDriver.get(url) does not open the URL Commented Oct 5, 2015 at 6:42
  • i dont have double profile in firefox. and i don't use poxy Commented Oct 5, 2015 at 6:46
  • I am using windows. how i solve this? is latest jar is compatible with firefox 41.0.1? am also using latest jar and latest firefox 41.0.1 Commented Oct 5, 2015 at 6:49

2 Answers 2

0

Code is working but optimize imports.

I run your code with minuscule edit. It opens google website. Reverify if you have imported both selenium-java and selenium-server-standalone jar files in the build path.

package com.jayant.selenium; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class SampleSelenium { public static void main( String[] args){ WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com"); } } 
Sign up to request clarification or add additional context in comments.

Comments

-1

Your code is perfect. It might be configuration issue i.e. use lower version of firefox with same code. It will work

3 Comments

Did you try it in a lower version or is it just a guess?
i used the same code in Mozilla Firefox 38.0 , it was working fine
it's a eclipse issue as I mentioned in my answer

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.