标签: selenium-rc

如何使用Selenium RC检索表格列中的文本?

我有一个如下所示的表:

<table class="theClass">
<tr>
   <td class="anotherClass"><strong>Label1:</strong></td>
   <td colspan="3">Value1a<br/>Value1b<br/>Value1c</td>
</tr>

<tr>
   <td class="anotherClass"><strong>Label2:</strong></td>
   <td colspan="3">Value2a<br/>Value2b<br/>Value2c</td>
</tr>

<tr>
   <td class="anotherClass"><strong>Label3:</strong></td>
   <td colspan="3">Value3a<br/>Value3b<br/>Value3c</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)

如何使用Selenium RC检索Value1a,Value1b和Value1c?我可以使用selenium.getText(...)或storeText(...)吗?如果是这样,我应该使用什么样的xpath?请假设表格无法更改.谢谢!

selenium selenium-ide selenium-rc

2
推荐指数
1
解决办法
2万
查看次数

Selenium从xpath获取动态id

在Selenium RC中有没有办法从xpath获取id?

如果我有xpath

/html/body/div/div//input
Run Code Online (Sandbox Code Playgroud)

我想获取与xpath关联的所有节点的id

selenium xpath selenium-rc

2
推荐指数
1
解决办法
9494
查看次数

将Selenium RC作为Windows服务运行

我正在尝试让Selenium设置作为Windows服务运行.它似乎没关系,但似乎没有正常运行.

使用windows工具包我做了:

"C:\Program Files\Windows Resource Kits\Tools\instsrv.exe" SeleniumRC
"C:\Program Files\Windows Resource Kits\Tools\srvany.exe" -a [SeleniumUser] -p [SeleniumUserPass]
Run Code Online (Sandbox Code Playgroud)

将以下内容保存为a.reg文件(然后双击它)

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SeleniumRC\Parameters]
"Application"="java.exe"
"AppDirectory"="C:\\Program Files\\selenium-server-1.0.3"
"AppParameters"="-Xrs -jar selenium-server.jar"
Run Code Online (Sandbox Code Playgroud)

我的SeleniumUser已被授予登录权限.

在服务MMC中启动服务

但是,当我来运行我的测试中心(简单的UI来调用和运行测试)时,我点击运行测试,然后它只是坐在plage加载swirly的东西,并说等待服务器的响应.

它几乎就像它正在运行,但它没有连接.

如果我通过命令行运行java调用,它会告诉我另一个服务正在该端口上运行.

如果我停止Windows服务,然后再次运行命令,它的工作原理(我的测试也是如此)

有没有人有什么想法?

windows-services selenium-rc

2
推荐指数
1
解决办法
4654
查看次数

如何使用Java在Selenium RC中使用xpath

我的应用程序有以下代码片段:

<form id="frmDepartmentCreation" name="frmDepartmentCreation" method="post" 
      action="">
    <table class="formStyle_1" border="0" cellpadding="0" cellspacing="10" 
            width="100%">
        <tr>
            <td>&nbsp;</td>
            <td align="left"><label class="formBtn_1">
                <input  id="Submit" name="Submit" value="Submit" type="submit" 
                        onclick="return val()"/></label>
                <input type="hidden" name="hdnbutton" id="hdnbutton" value=""/>
            </td>
        </tr>
    </table>
</form>
Run Code Online (Sandbox Code Playgroud)

考虑到上面的代码,"提交"按钮的xpath是什么?

java selenium xpath selenium-rc

2
推荐指数
1
解决办法
999
查看次数

从selenium rc升级到webdriver

我喜欢使用selenium rc 1.0.3(java客户端).如果我想升级到WebDriver,是否会向后兼容?它会像简单地使用webdriver jar和方法一样吗?或者,它会像废料一样写吗?

java webdriver selenium-rc selenium-webdriver

2
推荐指数
1
解决办法
1837
查看次数

如何获得Selenium RC服务器的版本

我正在使用selenium2 RC和python客户端(selenium.py),我需要在服务器上获取selenium的版本.(例如"2rc2","2rc3"等)

是否有任何命令我可以发送到服务器获取其版本?

python selenium-rc python-2.7 selenium-webdriver

2
推荐指数
1
解决办法
1万
查看次数

如何使用selenium selenium.select("","")选择下拉列表中的值?

我正在使用Selenium进行自动化.我正在使用DefaultSelenium课程,在我们的应用程序中我有一个下拉菜单.我想从这个下拉列表中获得一个值.

最初,我使用selenium IDE编写脚本,它给了我以下代码:

selenium.select("id=skuOptionSIZE1c4b403", "label=8");
Run Code Online (Sandbox Code Playgroud)

但是当我开始用代码(Java)编写时,Eclipse会抛出一个错误,而我仍然能够看到id页面上的下拉列表:

Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Element id=skuOptionSIZE1cd7bfd not found
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮助我如何从下拉中获取价值?

java selenium selenium-rc

2
推荐指数
1
解决办法
2万
查看次数

Selenium RC - 错误:无法找到或加载主类jar

我正在尝试在GOOGLE CHROME中运行FIREFOX selenium IDE生成的文件.

下面是对问题是什么以及我尝试过(迄今为止未成功)修复问题的逐步描述.

环境

Selenium IDE – installed**strong text**
Selenium RC – installed
Java version 1.7.0.05  - installed
Run Code Online (Sandbox Code Playgroud)

我正在尝试做什么:

在GOOGLE CHROME步骤中运行FIREFOX IDE生成的测试

(1) Following three .htm files created using FIREFOX
a.  google_for_selenium_rc.htm
b.  google_for_testing.htm
c.  visit_google_videos

(2) Created suite.htm file (see attached)

(3) Run the following command in cmd:

java –jar selenium-server.jar –htmlSuite “C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe¬” “http://www.google.com.au” 
“C:\Users\shelleymoudgil\Documents\KB\Selenium\SeleniumIDE\suite.htm” 
“C:\Users\shelleymoudgil\Documents\KB\Selenium\SeleniumIDE\results.htm”
Run Code Online (Sandbox Code Playgroud)

预期

(4) Script successfully executed in GOOGLE CROME
Run Code Online (Sandbox Code Playgroud)

实际

(5) Following Error displayed:
Run Code Online (Sandbox Code Playgroud)

错误:

  Could not find or load …
Run Code Online (Sandbox Code Playgroud)

java selenium runtime-error selenium-rc

2
推荐指数
1
解决办法
6888
查看次数

如何为Selenium网格Java Maven设置启动服务器

我用Maven Java设置了Selenium框架.所以所有依赖都存储在POM.xml中我怀疑..如何启动服务器java -jar selenium-server-standalone-2.18.0.jar -role hub ..我应该把这个jar再次放在某个文件夹中,我应该从那条路开始?或者我应该去Maven Dependencies文件夹(.m2\Repositories)?

任何人都可以建议我吗?

如果问题不明确,请回​​击.我将以不同的方式解释.

谢谢Raju

selenium selenium-grid selenium-rc selenium-webdriver

2
推荐指数
1
解决办法
8856
查看次数

Selenium - 代码 - chrome问题

在selenium服务器中使用codeception在chrome上运行测试时,我会随机获得以下错误:

WebDriver\Exception\UnknownError: The current platform is not supported: LINUX

WebDriver\Exception\UnknownError: Unable to find executable for product Opera Desktop

WebDriver\Exception\UnknownError: The path to the driver executable must be set by the phantomjs.binary.path capability/system property/PATH variable; for more information, see https://github.com/ariya/phantomjs/wiki. The latest version can be downloaded from http:\//phantomjs.org/download.html
Run Code Online (Sandbox Code Playgroud)

当给予firefox时,它工作正常.

运行selenium的命令:

java -jar selenium-server-standalone-2.31.0.jar -browser googlechrome
Run Code Online (Sandbox Code Playgroud)

以下是acceptance.yml内容

class_name: WebGuy
modules:
  enabled:
    - Selenium2
    - WebHelper
  config:
    Selenium2:
      url: 'http://www.google.com'
      browser: googlechrome
  delay: 350
Run Code Online (Sandbox Code Playgroud)

google-chrome selenium-rc selenium-webdriver

2
推荐指数
1
解决办法
4218
查看次数