我想用ANT來啓動一個Selenium網格實例。使用發現這裏的響應,How can I run Selenium 2 Grid from an Ant build?,我是能夠成功地利用以下的build.xml硒網格/醬實驗室插件/ Ant設置
<project name="selenium-grid" default="launch-hub" basedir=".">
<property name="selenium.version" value="2.28.0"/>
<property name="sauce.version" value="1.0.8"/>
<path id="selenium.classpath">
<pathelement path="${basedir}/"/>
<fileset dir="${basedir}/">
<include name="selenium-server-standalone-${selenium.version}.jar"/>
<include name="sauce-grid-plugin-${sauce.version}.jar"/>
</fileset>
<pathelement path="${java.class.path}/"/>
</path>
<target name="launch-hub"
description="Launch Selenium Hub">
<java classname="org.openqa.grid.selenium.GridLauncher"
classpathref="selenium.classpath"
fork="true"
failonerror="true">
<arg value="-role"/>
<arg value="hub"/>
</java>
</target>
</project>
ant launch-hub
移動,開始發車,我想用醬實驗室網的插件與硒網格這可以在這裏找到:https://github.com/rossrowe/sauce-grid-plugin/wiki 繼維基,我可以開始使用這兩個在我的Windows機器上從DOS
以下java -cp selenium-server-standalone-2.25.0.jar;sauce-grid-plugin-1.0.7.jar org.openqa.grid.selenium.GridLauncher -role hub -servlets com.saucelabs.grid.SauceOnDemandAdminServlet,com.saucelabs.grid.SauceOnDemandConsoleServlet
現在我想通過向目標納入醬實驗室的Servlet「launch-樞紐「在醬實驗室「的servlet」(對不起有麻煩發佈真正的代碼),我重新啓動使用
ant launch這裏這裏的論點
arg value="-servlets" arg value="com.saucelabs.grid.SauceOnDemandAdminServlet,com.saucelabs.grid.SauceOnDemandConsoleServlet"
是由Windows返回的錯誤:
launch-hub: [java] 17 janv. 2013 10:58:40 org.openqa.grid.selenium.GridLauncher main [java] INFO: Launching a selenium grid server [java] 17 janv. 2013 10:58:50 org.openqa.grid.web.utils.ExtraServletUtil createServlet [java] ATTENTION: The specified class : com.saucelabs.grid.SauceOnDemandAdminServlet cannot be instanciated com.sau celabs.grid.SauceOnDemandAdminServlet [java] 17 janv. 2013 10:58:50 org.openqa.grid.web.utils.ExtraServletUtil createServlet [java] ATTENTION: The specified class : com.saucelabs.grid.SauceOnDemandConsoleServlet cannot be instanciated com.s aucelabs.grid.SauceOnDemandConsoleServlet [java] 2013-01-17 10:58:50.806:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT [java] 2013-01-17 10:58:50.866:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null} [java] 2013-01-17 10:58:50.876:INFO:osjs.AbstractConnector:Started [email protected]:4444`enter code here
硒電網啓動但沒有servlets,因此沒有Saucelabs訪問
任何想法?
更新得到它使用1.0.7的醬插件工作。沒有去用版本1.0.8
感謝您的快速響應。不幸的是,這並不適合我。是的,兩個罐子都在$ {basedir}中。我有一個使用Selenium獨立服務器2.25.0的NullPointerException。使用2.28.0允許Grid開始減去小服務程序: -/ – Scott
好吧,你能夠使用-debug標誌(例如ant -debug)運行ant並附加日誌輸出嗎?在我的環境中,它包括以下內容:_Executing ..snip..java'with arguments: '-classpath' '/ Developer/workspace/sauce-grid-plugin:/ Developer/workspace/sauce-grid-plugin/sauce -grid-plugin-1.0.8.jar:/Developer/workspace/sauce-grid-plugin/selenium-server-standalone-2.25.0.jar: 'org.openqa.grid.selenium.GridLauncher' '-servlets ' 'com.saucelabs.grid.SauceOnDemandAdminServlet,com.saucelabs.grid.SauceOnDemandConsoleServlet' '-role' 'hub'_(道歉格式:) –
請隨時在Sauce Grid Plugin中提出問題[問題註冊](https://github.com/rossrowe/sauce-grid-plugin/issues):) –