Hi I am new to IOS automation and I have a scenario where we have to do an In-App purchase
As for Testing these could be done by AppStore Connect Portal under User Access and create a Sandbox account but is there a way by which we can create an Apple (Appstore Connect) Sandbox account programmatically
Please advise
Well, it isn't much of a solution and it is a PITA but you could use something like Appium, which is what I use, to automate all that stuff by driving a web browser.
I use it for testing 3rd party social logins. For things like Apple ID where the social login requires 2FA I have an Appium test step that goes to a google voice account in the mobile browser and retrieves the 2FA code that was texted to the GV number. It is tedious and a bit brittle but I couldn't find any other way to get around 2FA situations.