I'm curious if there is a way to make a post with JSON data attached to it in test studio? This would make it easy for me to departmentalize some of my testing and feature sets.
3 Answers, 1 is accepted
Test Studio does not have a built-in feature to do a POST with any random JSON data. Test Studio was designed to drive the browser, let it do all the GET's and POST's and the validate what is loaded in the browsers DOM contains the expected results.
You could write code in a coded step to do this. Normally this would be beyond our ability to help (other than pointing you in the right direction) but I happened to work on a project recently that required this. Here's the code I used in that project:
Thanks for the code! I had it working within a few minutes. =D
So in attempts to better compartmentalize our tests, I'm trying to use this post to skip a page on UI testing. Taking from your response, I assume I may be out of luck... I'm going to give you my scenario, to make sure I'm on the same page.
I have a page that contains a AJAX requested list of items, essentially each list posts to redirect the browser with an item ID. This ID signifies what you clicked on. So if I have a list of people, Adam, Bob, Alice, and I click on Alice with ID 3, it will POST with that ID to the manageuser page. What I'm trying to do is manually POST so that I don't have to go through the process of waiting for the page to load, waiting for the AJAX, looking for the object and clicking the object to make the POST and have the browser redirect.
Currently it looks like I won't be able to drive the browser this way.
Anyway thanks again for the response! I appreciate it!