Selenium和Spring无法调用@Configuration方法

时间:2012-08-23 21:39:42

标签: spring selenium testng

我是这一切的新手,并且设置起来有点压倒性。我正在使用ant运行一系列使用testng套件的测试。

我遇到了这个错误:

[testng] Failed to invoke @Configuration method org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance:Error creating bean with name 'com.mystuffs.tests1.CreateTest1': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.mystuffs.web.BrowserTest1.setBrowser(com.mystuffs.web.browser.Browser); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'browser' defined in class path resource [applicationcontext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser

它看起来像某种依赖性问题,但我不知道如何继续。任何建议表示赞赏!

1 个答案:

答案 0 :(得分:0)

您尝试过什么:问题是您尝试在启动应用程序时实例化Selenium浏览器会话,这会导致错误:

  

java.lang.RuntimeException:无法启动Selenium会话:无法启动新的浏览器会话:启动浏览器时出错

所以你应该看看为什么selenium无法启动浏览器