Java/Webdriver - opening a Firefox instance - firefoxbinary and setenvironmentproperty

StackOverflow https://stackoverflow.com/questions/17854511

  •  04-06-2022
  •  | 
  •  

문제

Im trying to launch a Firefox instance with webdriver, but I want to instruct it to use certain xvfb display. I think something is wrong with my code, though

   FirefoxBinary ffox = new FirefoxBinary();
   ffox.setEnvironmentProperty("DISPLAY", "22");
   driver = new FirefoxDriver();

As you can see, at no point there is any mention to the "new firefoxdriver()" to use that ffox setting, but when I put ffox in the brackets of FirefoxDriver, my code goes red, because it can't accept such thing.

Is there something wrong with my code?

도움이 되었습니까?

해결책

You need to set System property to use the FF binary. Refer here http://code.google.com/p/selenium/wiki/FirefoxDriver

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top