【问题标题】:Can not open jar file from Selenium IDE无法从 Selenium IDE 打开 jar 文件
【发布时间】:2017-03-06 07:34:09
【问题描述】:

我无法打开之前从 selenium ide 导出为 jar 文件的测试用例文件 步骤:

1)打开selenium ide并记录一个测试用例

2)将测试用例导出为jar文件

3)关闭硒ide

4) 再次打开 selenium ide

5)文件->打开->file.jar

它将显示以下错误:错误加载测试用例未找到命令

有什么帮助吗?

【问题讨论】:

    标签: selenium


    【解决方案1】:

    保存 Selenium IDE 记录的默认格式是 HTML。例如:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head profile="http://selenium-ide.openqa.org/profiles/test-case">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="selenium.base" href="https://en.wikipedia.org/" />
    <title>selenium</title>
    </head>
    <body>
    <table cellpadding="1" cellspacing="1" border="1">
    <thead>
    <tr><td rowspan="1" colspan="3">selenium</td></tr>
    </thead><tbody>
    <tr>
        <td>open</td>
        <td>/wiki/Main_Page</td>
        <td></td>
    </tr>
    <tr>
        <td>type</td>
        <td>id=searchInput</td>
        <td>selenium software</td>
    </tr>
    <tr>
        <td>clickAndWait</td>
        <td>id=searchButton</td>
        <td></td>
    </tr>
    <tr>
        <td>clickAndWait</td>
        <td>//div[@id='mw-content-text']/div/ul/li/div/a/span[2]</td>
        <td></td>
    </tr>
    
    </tbody></table>
    </body>
    </html>
    

    该文件可以在 Selenium IDE 中加载(选项 File->Open),但不能在 JAR 中加载。更多信息here

    【讨论】:

    • 是的,但我的问题是我需要修改代码。在 html 中我无法编写脚本,例如我需要读取一个文本框并确保它是正确的,所以我需要用 java 编写或 python 不在 html 中
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-23
    • 1970-01-01
    • 1970-01-01
    • 2023-03-28
    • 1970-01-01
    • 2012-06-10
    • 1970-01-01
    相关资源
    最近更新 更多