Bookmarklet to auto-fill “Add New Test User” form in iTunesConnect

Sandbox test users for testing your In-App Purchase, tend to break very quickly, as they are blocked by Apple as soon as you (accidentally) use them in the App Store app (which happens very easily by mistake). If you want to create a bunch of new test users, you have to fill in a lengthy form in iTunesConnect for each one of them. Make sure you set up a catch-all on your e-mail server.

Here is a bookmarklet that auto-fills the whole form. You only need to press the “Save” button now.

javascript:var country = "75"; var rnd = Math.round(100000 * Math.random()).toString(); document.getElementsByName('0.0.9.7.3.1.19.1')[0].value = "Noodle" + rnd; document.getElementsByName('0.0.9.7.3.1.19.3')[0].value = "Werk" + rnd; document.getElementsByName('0.0.9.7.3.1.19.5')[0].value = "test" + rnd + "@mydomain.com"; document.getElementsByName('0.0.9.7.3.1.19.7')[0].value = "SBTest01"; document.getElementsByName('0.0.9.7.3.1.19.9')[0].value = "SBTest01"; document.getElementsByName('0.0.9.7.3.1.19.11')[0].value = "What's this nonsense?"; document.getElementsByName('0.0.9.7.3.1.19.13')[0].value = "Your Mother, doophus."; var monthOptions = document.getElementsByName('0.0.9.7.3.1.19.15')[0].childNodes; for (var m in monthOptions) { if (monthOptions[m].value === "1") { monthOptions[m].selected = true; }; }; var dayOptions = document.getElementsByName('0.0.9.7.3.1.19.16')[0].childNodes; for (var d in dayOptions) { if (dayOptions[d].value === "1") { dayOptions[d].selected = true; }; }; var countryOptions = document.getElementsByName('0.0.9.7.3.1.19.18')[0].childNodes; for (var c in countryOptions) { if (countryOptions[c].value === country) { countryOptions[c].selected = true; }; };