Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I have created a simple test that launches browser and calls a URL. This works fine in IE but when I select Firefox (FF) browser it opens blank. See the code snippet below.

The issue is similar to this post Post that concludes one has to change the settings in about:config's toolkit.telemetry.prompted to 2. But in my case its already 2, hence I have posted the issue.

Any help would be appreciated.

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.server.SeleniumServer;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;

import com.thoughtworks.selenium.*;

public class BascOne  extends SeleneseTestBase {
    private SeleniumServer seleniumserver;

    //start the selenium server
    @Before
    public    void startServer()
    {
        try {


        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }


    @Test
    public void launchTest() throws Exception
    {
        seleniumserver = new SeleniumServer();

        seleniumserver.start();


        setUp("http://yahoo.com/", "firefox");
        selenium.windowMaximize();
        selenium.windowFocus();


        System.out.println("IN THE  TEST METHOD");

        selenium.open("http://yahoo.com/");    

        System.out.println("BEFORE WAIT");        

        if(selenium != null){
            System.out.println("Is there any exception");
            try {
                System.out.println("In the try block");

                selenium.close();
                selenium.shutDownSeleniumServer();        


            } catch(Exception exp) {
                System.out.println("Shutdown exception: " + exp.getMessage());
            }

        }

    }


    @After
    public void tearDown()  {
    }    
}
share|improve this question
1  
May I suggest to use WebDriver APIs (aka Selenium 2) if you have begun with Selenium? –  Tarun Nov 15 '12 at 5:33
    
On a side, how does it compile if in startServer() has no block throwing exception? –  dzieciou Nov 15 '12 at 7:00
    
I am also facing same issue. but when i run program using JUnit it runs successfully and with TestNG FF shows blank screen. Please help –  user4442 Nov 27 '12 at 6:47
add comment

2 Answers 2

up vote 1 down vote accepted

This is because of compatibility issue with your browser and Selenium libs. Selenium libs 2.16 supports Firefox version 3.6 to 11, and for 12 you have to upgrade your Selenium libs to 2.22.

share|improve this answer
add comment

I had a similar issue and found the problem was the combination of firefox version and selenium server version. You could try either downgrading firefox or upgrading selenium to the latest version.

Check out http://seleniumhq.org/about/platforms.html#browsers browsers supported in the latest versions, note that the latest version only supports up to firefox 10 at the moment...

share|improve this answer
    
yes, I did downgrade to 3.6(was using that earlier) & it works. based on the link that u sent, will try v 10 & see if that helps as well. –  Tahir Shabbir May 29 '12 at 6:41
1  
No, I face the same issue. Get message from FF when it launches - Will you help FF by sending anonymous information about performance, hardware characteristics ...... to mozilla. And 2 options : Yes, I want to help or no. After clicking on either of them I am not able to proceed anywhere. –  Tahir Shabbir May 29 '12 at 7:01
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.