3

On my application payment gateway is Braintree, I need to automate it and face some difficulties when I am automating it, the major problem is I cannot send credit card details using xpath, I research some tutorial for solve this and not find any good resources, please advise and guide me how I automate payment form using selenium

JAINAM
1,8453 gold badges19 silver badges39 bronze badges
asked Aug 22, 2017 at 4:25
1
  • I am also facing the same issue. not able to automate braintree field by selenium. Commented Feb 2, 2021 at 10:13

1 Answer 1

0

To achieve the required automation testing services, you will have to use switchTo frame as mentioned in the link, https://stackoverflow.com/questions/9942928/how-to-handle-iframe-in-selenium-webdriver-using-java

Also, for braintree the locators may differ from what you see while using inspection tool , so I will suggest to confirm the actual locators by printing the page source and checking.

You might land into domain security problem while switching to the Braintree iframe. You may try workarounds as per link, https://appium.io/docs/en/advanced-concepts/cross-domain-iframes/

And lastly, if nothing else works you can try to find co-ordinates of the credit card text field relative to some other element that webdriver can find and then simply use sendKeys(). Something like,

Actions actions = new Actions(webDriver);

actions.moveToElement(some_findable_element, x_distance_to_cc_field, x_distance_to_cc_field).click().perform();

actions.sendKeys(cc_number);

answered Mar 5, 2021 at 11:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.