0

我需要在 selenium 中创建以下测试用例并寻求帮助 1.在浏览器中打开一个站点http://foo.bar 2.登录到站点 3.选择一些内容并存储在一个变量中(这可以通过 selenium storeValue 完成) 4. 打开另一个站点http://baz.bar 5. 登录站点 6. 使用存储的内容在该站点中搜索

我的问题是哪个 selenium 命令将对应于第 6 步。

我已经通过硒参考绞尽脑汁,但找不到这个特定的命令。

4

1 回答 1

1

下面的代码可能会对您有所帮助。

selenium.open("http://air.irctc.co.in/");
selenium.waitForPageToLoad("3000");
String content= selenium.getText("link=www.irctc.co.in");
//System.out.println(cc);
selenium.open("http://www.google.com");
selenium.waitForPageToLoad("3000");
selenium.type("q",content);
selenium.click("btnG");
selenium.waitForPageToLoad("3000");

在上面的代码中,我在使用 Google 搜索后将链接存储在内容变量中。

于 2011-04-26T08:46:47.197 回答