How to clone test steps and use a different resource.
My dev team has created a new version of an Api and are using v1 for the original that I have 30 test steps already created and refined. For the new version, they are changing the endpoint to denote v2. So v1 looked like this "/api/v1/sample/sample" and v2 uses "/api/v2/sample/sample".
I was able to clone the API and make the necessary change. But for my tests I want them to point to the cloned Api(V2). Is there any way to do this easily? I do not want to create new test steps all over again and rebuild all the headers.
Note the Resource field cannot be edited in the Test Step editor.
Solved! Go to Solution.
I tried removing v1 Api, because sometimes when you launch ReadyApi if there are unassigned APIs to steps it lets you assign them then and there. But the steps are automatically removed when the API is deleted. I'm basically at the point where I'll have to edit the Project Xml, which I don't want to do. There must be something basic I am missing?
So I decided to edit the Project XML. I searched for the test case name and edited the service and resource path for each step in a text editor. I also edited the originalUri but I'm not sure yet if that was the right move.
I had some issues with Environments configuration in the GUI, where it was not picking up the name of the cloned API, so I had a duplicate Rest Service with the same name. This could be a separate thread I'm sure. But I edited that in the Xml as well.
It makes me wonder why SmartBear does not allow editing of the Resource in the Test Step editor?
Ive had to edit the underlying project .xml myself on occasion. Just saying be careful and at least edit the file in something like xmlspy which has both wellformed checks and validator checks. It'll be a lot easier to see what youre doing and ensure you dont break the xml (make it malformed) when editing if youre editing in something with an xml parser like xmlspy.
Re: not allowing you to edit apis in the test step editor. The trouble with this approach is that the apis are setup almost like a parent record and the associated test step is a child of that api. If you could edit the api via teststep editor this could break the child teststep records, hence why i think you cant do this for now.
Thanks, Richie! I'll give xmlspy a try when I'm back at my desktop. I was using Notepad++. Testers making coding mistakes... no never happens 😉
Thanks for all the tips. I am new around here and forget to look before I leap.
I appreciate notepad++ is open source (so attractive to use) but ive had instances where an .xml file was marked as valid by notepad++ (with the XML plugin) which was invalid in xmlspy.
I double checked and discovered that notepad++ was erroneously classing an invalid xml instance as valid.
After that my goto app for xml/json wellformed/valid checks was always xmlspy