Selenium RC测试(PHPUnit) [英] Selenium RC test (PHPUnit)
问题描述
使用,Centos,Apache,PHPUnit,Selenium RC,
我试图测试在我的一个
java -jar selenium-server-standalone-2.4.0.jar
java -jar selenium-server-standalone-2.4.0.jar
最初我得到firefox创建配置文件的错误,它没有加载任何东西,并给出错误。
Initially i got error of firefox creating profile and it doesnot load anything up and gives error.
其次,我试图做
java -jar selenium-server-standalone-2.4.0.jar -firefoxProfileTemplate
/ root / .mozilla / firefox /&
java -jar selenium-server-standalone-2.4.0.jar -firefoxProfileTemplate "/root/.mozilla/firefox/" &
仍显示错误
错误 - 无法启动新的浏览器会话,关闭浏览器和
清除所有会话数据
ERROR - Failed to start new browser session, shutdown browser and clear all session data
INFO - 结果:无法启动新的浏览器会话:在会话空时启动浏览器时出错
INFO - Got result: Failed to start new browser session: Error while launching browser on session null
请分享您的看法可能的问题,
运行Mock ,它是工作,为测试目的,但firefox,无法午餐浏览器会话
Please share your view what may be the problem, Running Mock , it is working, for test purpose, but firefox, is unable to lunch browser session.
注意:它不是GUI模式(NO X),它有firefox版本3.6 .18,
Note: its not GUI mode (NO X), it has firefox version 3.6.18,
09:48:20.312 INFO - Got result: Failed to start new browser session: Error while launching browser on session null
09:48:39.659 INFO - Command request: getNewBrowserSession[*firefox3, http://google.co.uk] on session null
09:48:39.659 INFO - creating new remote session
09:48:39.660 INFO - Allocated session 17b9149077f648d3bc89b3f106466c6c for http://google.co.uk, launching...
09:48:39.860 INFO - Preparing Firefox profile...
09:49:00.017 ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: Timed out waiting for profile to be created!
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:360)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:114)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:83)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession(FirefoxChromeLauncher.java:412)
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:375)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:87)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:785)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:422)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:393)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:146)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
09:49:00.048 INFO - Got result: Failed to start new browser session: Error while launching browser on session null
推荐答案
经过一整天的研究,我得到了解决方案
After, a whole day research, i got the solution, which may be useful for all of you if this is the case..
如果有问题:由于显示问题,您可能会遇到一些问题,如firefox个人资料,以及
If Any issue: Due to the Display issue you may face several problem, such as firefox profile, and firefox lunching, and not being able to load.
Firefox配置文件问题:如果您没有在给定计算机上复制并粘贴另一台计算机。
Firefox Lunching问题:在null上没有会话: yum install xorg-x11-Xvfb&& Xvfb:99 -ac&& export DISPLAY =:99&&& firefox
如果您看到有关xvfb:99的任何问题,您可能必须删除锁定文件。
Firefox Profile Issue: Copy and paste from another machine if you dont have in given machine. Firefox Lunching Issue: With No session on null: yum install xorg-x11-Xvfb && Xvfb :99 -ac && export DISPLAY=:99 && firefox Here if you see any issue regarding xvfb :99 you may have to delete the lock file.
服务器已激活显示99
如果此服务器不再运行,请删除/tmp/.X99-lock
,然后重新启动。
Server is already active for display 99 If this server is no longer running, remove /tmp/.X99-lock and start again.
Firefox应该启动没有错误,并保持运行(直到你杀死它与Control-C)
Firefox should launch without error, and stay running (until you kill it with Control-C)
这篇关于Selenium RC测试(PHPUnit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!