Selenium Grid 会在 NAnt(不是 Ant)下运行吗?

发布于 2024-08-03 23:20:08 字数 394 浏览 4 评论 0原文

我正在尝试让 Selenium Grid 使用 NAnt 运行,但我有点迷失,因为我能找到的所有解释都使用 Ant - 尽管我认为它们非常相似,但我似乎无法在本地 PC 上启动 Selenium Grid方式。

这是我找到的 Selenium Grid 在线页面的 URL,但它们引用了 Ant...

开始使用

...引导

运行演示

I am trying to get Selenium Grid to run using NAnt but am a little lost, as all explanations I can find use Ant - although I thought they were fairly similar, I can't seem to fire off Selenium Grid on my local PC in this way.

Here's the URLs to the Selenium Grid pages online that I've found, but they refer to Ant...

Get started

...leading on to

Run the demo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

神经暖 2024-08-10 23:20:08

从 Selenium 网格页面:

要运行 Selenium Grid,您需要在系统上安装有效的 Java 5+ JDK。

AFAIK NAnt 设计用于.Net,而不是 Java,所以我认为最好的选择是按照说明安装 Ant、Java 1.5 和 Selenium Grid,然后使用 NAnt 执行任务

From the Selenium Grid page:

To run Selenium Grid, you need a valid Java 5+ JDK install on your system.

AFAIK NAnt is designed to work with .Net, not Java, so I think your best bet is to install Ant, Java 1.5 and Selenium Grid per the instructions, then invoke the ant task with a NAnt exec task.

初见终念 2024-08-10 23:20:08

这很容易:

  <property name="selenium.server.file" value="${src.dir}\_tools\selenium\selenium-server.jar" />
  <property name="selenium.grid.hub.file" value="${src.dir}\_tools\selenium\selenium-grid-hub-standalone-1.0.4.jar" />
  <property name="selenium.grid.rc.file" value="${src.dir}\_tools\selenium\selenium-grid-remote-control-standalone-1.0.4.jar" />

启动 hub:

 <target name="start.selenium.grid.hub">
    <exec program="java" verbose="true" failonerror="false">
      <arg value="-jar" />
      <arg value="${selenium.grid.hub.file}" />
    </exec>
  </target>

启动 rc:

<target name="start.selenium.grid.rc">
    <exec program="java" verbose="true" failonerror="false">
      <arg value="-classpath" />
      <arg value="${selenium.server.file};${selenium.grid.rc.file}" />
      <arg value="com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringRemoteControlLauncher" />
    </exec>
  </target>

或简单地从命令行:

java -jar D:\work\SeleniumDesign\build_artifacts\artifacts\continuous\source_tools\selenium\selenium-grid-hub-standalone-1.0.4.jar

java -classpath D:\work\SeleniumDesign\build_artifacts\artifacts\连续\source_tools\selenium\selenium-server.jar;D:\work\SeleniumDesign\build_artifacts\artifacts\连续\source_tools\selenium\selenium-grid-remote-control -standalone-1.0.4.jar com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringRemoteControlLauncher

it is easy:

  <property name="selenium.server.file" value="${src.dir}\_tools\selenium\selenium-server.jar" />
  <property name="selenium.grid.hub.file" value="${src.dir}\_tools\selenium\selenium-grid-hub-standalone-1.0.4.jar" />
  <property name="selenium.grid.rc.file" value="${src.dir}\_tools\selenium\selenium-grid-remote-control-standalone-1.0.4.jar" />

start hub:

 <target name="start.selenium.grid.hub">
    <exec program="java" verbose="true" failonerror="false">
      <arg value="-jar" />
      <arg value="${selenium.grid.hub.file}" />
    </exec>
  </target>

start rc:

<target name="start.selenium.grid.rc">
    <exec program="java" verbose="true" failonerror="false">
      <arg value="-classpath" />
      <arg value="${selenium.server.file};${selenium.grid.rc.file}" />
      <arg value="com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringRemoteControlLauncher" />
    </exec>
  </target>

or simply from command line:

java -jar D:\work\SeleniumDesign\build_artifacts\artifacts\continuous\source_tools\selenium\selenium-grid-hub-standalone-1.0.4.jar

and

java -classpath D:\work\SeleniumDesign\build_artifacts\artifacts\continuous\source_tools\selenium\selenium-server.jar;D:\work\SeleniumDesign\build_artifacts\artifacts\continuous\source_tools\selenium\selenium-grid-remote-control-standalone-1.0.4.jar com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringRemoteControlLauncher

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文