Forum Discussion

MojoLA's avatar
MojoLA
Occasional Contributor
7 years ago

With "New REST Service from URL" I get an extra slash.

Being unable to add a POST resource to a TestCase when both POST and GET methods are available, I've been working around it by attempting to add a New REST Service from a URL.

 

Suppose I have a local instance of my test service at http://localhost:8080/service/resource

 

I can create a POST request.

 

Now I want to change the Endpoint to ${#Project#Endpoint} so I can run the test against multiple other deployments on the runway. I can do that with no problem.

 

Now I want to change the basepath for the resource from "/service" to ${#Project#basepath}, which is likely to be /service/environment/organization/some/proxy/address/contract/version to which the resource is appended "/resource"

 

If I edit the Resource Path from the Resource screen in the Project and change it to ${#Project#basepath} instead it turns it into /${#Project#basepath}. There is no method I can discover that does not prepend a slash onto the resource.

 

When a TestCase is created, it becomes ${#Project#Endpoint}/${#Project#basepath}, and since my basepath always has a slash at the start, I get a double slash in the full URL.

 

Now normally this is a purely aesthetic problem, because double slash in a URL path tends to be harmless. But my OCD in this matter beats at me incessantly.

 

Mojo

4 Replies

  • MojoLA's avatar
    MojoLA
    Occasional Contributor

    Here's the extra slash that SoapUI insists on prepending to my resource, giving me a double slash, which you can see in the Raw call to my request:

     

    • Bill_In_Irvine's avatar
      Bill_In_Irvine
      Contributor

      What  corresponding "Value" do you give to your basepath name in "Custom Properties" under your active Environment?

       

      Does it start with /service or does it start with service?

       

      Does trying with just service/.... make any difference?

      • MojoLA's avatar
        MojoLA
        Occasional Contributor

        The value for #Project#basepath is calculated based on properties set on the command line by the testrunner. Typical might be:

         

        basepath = /service/stb/show/media/playist/4

         

        I suppose I'll have to change my scripts to eliminate the slash on the front of the basepaths. :(