gpt4 book ai didi

java - 从 Tomcat 使用 WebDriver

转载 作者:行者123 更新时间:2023-11-28 23:43:11 24 4
gpt4 key购买 nike

我尝试在我的 Tomcat webapp 中包含 selenium-server-standalone-2.33.0.jar,但是 Tomcat 说:

validateJarFile([path to jar]) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

所以我用谷歌搜索并在 Selenium 网站上看到了这个:

You may, or may not, need the Selenium Server, depending on how you intend to use Selenium-WebDriver. If you will be only using the WebDriver API you do not need the Selenium-Server. If your browser and tests will all run on the same machine, and your tests only use the WebDriver API, then you do not need to run the Selenium-Server; WebDriver will run the browser directly.

我只需要 WebDriver...我从哪里得到它,这样我就可以在我的 webapp 中使用它而不会引起服务器冲突?

最佳答案

需要下载的是客户端库,例如来自 http://code.google.com/p/selenium/downloads/list 的 selenium-java-2.33.0.zip

The Java bindings for Selenium 2, including the WebDriver API and the Selenium RC clients. Download this if you plan on just using the client-side pieces of Selenium

主要描述http://docs.seleniumhq.org/download/页面并没有真正说明这一点 IMO

In order to create scripts that interact with the Selenium Server (Selenium RC, Selenium Remote Webdriver) or create local Selenium WebDriver script you need to make use of language-specific client drivers.

关于java - 从 Tomcat 使用 WebDriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17409320/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com