英文:
Can't click Continue button on PayPal using Selenium
问题
我已经通过PayPal沙箱自动化付款,直到最近几天它都运行良好。但现在那里发生了一些变化,无论我怎么做,都无法再点击最后的“继续”按钮。我尝试了一切:普通点击、Actions类、JS点击、连续点击多次。没有任何帮助。最奇怪的是,当我在控制台中执行以下操作时:document.getElementById('payment-submit-btn').click(); 它可以运行,付款完成,但是当我使用JavaScriptExecutor执行相同的脚本时,它就不再起作用,按钮无法被点击。有解决这个问题的方法吗?
英文:
I've automated payment via PayPal SandBox and it used to work well until recent days. Now something has changed there and I can't click the final Continue button anymore no matter what I do. I've tried everything: regular click, Actions class, JS click, several clicks in a row. Nothing helps. The strangest thing is that when I do this in console: document.getElementById('payment-submit-btn').click(); It works and the payment completes but when I execute the same script using JavaScriptExecutor it doesn't work anymore and the button doesn't get clicked. Is there a way to solve this?
答案1
得分: 1
请使用以下 XPath 来点击“继续”按钮:
//*[contains(text(),'继续')]
或者
//button[contains(text(),'继续')]
英文:
Please use this xpath to click continue button
**//*[contains(text(),'Continue')]**
OR
//button[contains(text(),'Continue')]
答案2
得分: 0
对于我来说,有时候 PayPal 的弹出窗口会出现带有“cookie”消息,并且窗口没有完全打开(继续按钮被隐藏)。
您可以通过以下步骤实现 100% 的点击 -
- 确保购物车按钮已加载。(在这里我们验证弹出窗口是否已加载)
- 接受弹出窗口上的 cookie 消息/按钮。
- 最大化页面。
- 点击继续按钮。
英文:
For me, sometimes the PayPal pop-up open with "cookie" message and window is not full opened (continue button) is hidden.
You can achieve 100% clicking By -
- Verify Cart button is loaded. (here we verify pop-up is loaded)
- Accept the cookie message/button on pop-up.
- Maximize the page.
- Click on continue button.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论