开发者

Paypal-Sandbox buying with Selenium RC

开发者 https://www.devze.com 2023-03-14 04:01 出处:网络
I\'m trying to buy something at Paypal-Sandbox with Selenium RC (Java), but it doesn\'t work. I tried it with Selenium IDE (Firefox AddOn) and it did work. I changed the viewing and copied the JUnit

I'm trying to buy something at Paypal-Sandbox with Selenium RC (Java), but it doesn't work.

I tried it with Selenium IDE (Firefox AddOn) and it did work. I changed the viewing and copied the JUnit 4 Code and it still doesn't work.

The problem is the part with the radio-button "payment_type_paypal". Somehow it doesnt work in RC (the radio-button is not checked). Do someone have 开发者_如何学Gosimiliar experiences and/or resolved the issue?

After loging in to developer.paypal.com and entering the homepage...

//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);

Thx :)


its me againg, Krzys. I know now the Problem. Its an issue with focussing the correct frame. I couldn't get it work with Selenium RC.

You can easily fix the issue in Selenium WebDriver with the command, before my "point of error":

  driver.switchTo().defaultContent();


its me again. If you encounter problems with the Sandbox System of Paypal, you can overcome the "submit"-button issues using xpath.

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

Greetz Krzys

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号