3

我正在尝试使用 Selenium RC (Java) 在 Paypal-Sandbox 购买一些东西,但它不起作用。

我用 Selenium IDE (Firefox AddOn) 进行了尝试,它确实有效。我更改了查看并复制了 JUnit 4 代码,但它仍然无法正常工作。

问题在于单选按钮“payment_type_paypal”的部分。不知何故,它在 RC 中不起作用(未选中单选按钮)。有人有类似的经历和/或解决了这个问题吗?

登录 developer.paypal.com 并进入首页后...

//linking homepage

selenium.click("legalTerms");

selenium.click("pay");

selenium.waitForPageToLoad("30000");

//leaving homepage and switching to paypal

selenium.click("payment_type_paypal"); // <===== point of error

selenium.type("login_email",username);

selenium.type("login_password",pw);

谢谢 :)

4

2 回答 2

2

又是我。如果您在使用 Paypal 的沙盒系统时遇到问题,您可以使用 xpath 解决“提交”按钮问题。

driver.findElement(By.xpath("//div[@id='nav-menu']/form/ul/li/ul/li[6]/input")

格雷茨·克日斯

于 2012-01-19T10:06:22.583 回答
2

又是我,Krzys。我现在知道问题所在。这是聚焦正确框架的问题。我无法让它与 Selenium RC 一起使用。

在我的“错误点”之前,您可以使用以下命令轻松修复 Selenium WebDriver 中的问题:

  driver.switchTo().defaultContent();
于 2011-10-06T11:35:48.237 回答