运行脚本selenium RC时出错

时间:2012-02-06 10:29:13

标签: selenium automation selenium-rc

我正在使用firefox 8.0.1处理selenium 2.18.0版本。执行脚本时我收到错误

15:52:07.342 INFO - Started HttpContext[/wd,/wd]
15:52:07.347 INFO - Started SocketListener on 0.0.0.0:5603
15:52:07.348 INFO - Started org.openqa.jetty.jetty.Server@33db4f6f
15:52:07.441 INFO - Preparing Firefox profile...
15:52:11.549 INFO - Launching Firefox...
15:52:15.106 INFO - Checking Resource aliases
15:52:17.008 INFO - Checking Resource aliases
15:52:17.012 INFO - Received posted results
15:52:17.558 INFO - Killing Firefox...
15:52:17.560 WARN - Firefox seems to have ended on its own (did we kill the real
 browser???)
15:52:17.588 INFO - Shutting down...

所以我无法运行脚本。

我该怎么办才能解决此错误?

这是我使用IDE生成的脚本

<tr>
    <td>open</td>
    <td>http://www.gmail.com</td>
    <td></td>
</tr>
<tr>
    <td>type</td>
    <td>id=Email</td>
    <td>test</td>
</tr>
<tr>
    <td>type</td>
    <td>id=Passwd</td>
    <td>test</td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>id=signIn</td>
    <td></td>
</tr>
<tr>
    <td>clickAt</td>
    <td>//div[@id=':oy']/div/div</td>
    <td></td>
</tr>
<tr>
    <td>type</td>
    <td>name=to</td>
    <td>test@test.com</td>
</tr>
<tr>
    <td>type</td>
    <td>name=subject</td>
    <td>testSubject</td>
</tr>
<tr>
    <td>type</td>
    <td>css=body[class='editable&nbsp;&nbsp;LW-avf']</td>
    <td>asdasd</td>
</tr>
<tr>
    <td>keyPress</td>
    <td>//div/b[text()='Send']</td>
    <td>13</td>
</tr>

我必须在selenium RC

上运行它
Java code

    package com.example.tests;

    import com.thoughtworks.selenium.*;
    import java.util.regex.Pattern;

    public class 123 extends SeleneseTestCase {
        public void setUp() throws Exception {
            setUp("http://www.google.com/", "*chrome");
        }
        public void test123() throws Exception {
            selenium.start();
            selenium.open("http://www.gmail.com");
            selenium.type("id=Email", "asd");
            selenium.type("id=Passwd", "trest");
            selenium.click("id=signIn");
            selenium.waitForPageToLoad("30000");
            selenium.clickAt("//div[@id=':oy']/div/div", "");
            selenium.type("name=to", "test@test.com");
            selenium.type("name=subject", "testSubject");
            selenium.type("css=body[class='editable  LW-avf']", "asdasd");
            selenium.keyPress("//div/b[text()='Send']", "13");
        }
    }

0 个答案:

没有答案