Forum Discussion

hitesh1304's avatar
hitesh1304
New Contributor
14 years ago

Create a Login Test

Hi,

I have just download a SoAP UI and creating a first project for doing a Login test.
I have SoAP request for Login which I am adding in my test case.
Following are the steps that I followed:
1. Created a "Properties" step which will have 2 properties: UserName and Password
2. Created a new Transfer properties step which will read values from the above step and will pass that information to SoAP request of login

When I run this test, values are not getting transferred to the SoAP request which fails my test.

I am not sure what I am missing here.

Can any one please help me with this?

4 Replies

  • deepesh_jain's avatar
    deepesh_jain
    Frequent Contributor
    Hi Hitesh,

    I don't think, you need property transfer step to transfer properties from properties step to SOAP Request. In your SOAP request, you can just right click the value of node which you need to get from properties file and select Get from and select the properties step name and then the property.

    The reason why you might be getting an error could be quite a few. Try checking the end point. Also are you getting a soap fault or a time out? The details of the error might help diagnose the issue.

    Regards,
    Deepesh Jain
  • hitesh1304's avatar
    hitesh1304
    New Contributor
    Hi Dipesh,

    Thanks for your help. I was able to get it successfully.

    ~Hitesh
  • hitesh1304's avatar
    hitesh1304
    New Contributor
    Hi Dipesh,

    One more help.
    I am getting the following response from my Login Request:
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
    <LoginResponse xmlns="http://tempuri.org/">
    <LoginResult>{"sessionidentity":{"SessionID":"c121d901-22dc-40ec-8562-4aefaccc893b","UserID":"aa819828-78b1-4007-96d4-49113fdf5ef6","TenantCode":432,"UserSessionCode":16867},"success":"true","usertype":"instructor","reason":"successfully authenticated"}</LoginResult>
    </LoginResponse>
    </s:Body>
    </s:Envelope>

    I want to capture the session ID from this response. Can you please tell me how do I achieve that?

    I tried with the sample example given in the tutorial but the response that is given there and what I am getting here is different and that is why I am not able to capture it.

    Can you please help me with this?

    Thanks,
    Hitesh
  • deepesh_jain's avatar
    deepesh_jain
    Frequent Contributor
    Sure. Basically you need to understand what you are getting in the response and what you need.
    To begin with you are getting a big string in your response for the value of node "LoginResult". Now out of this BIG string, you are trying to capture a substring ("SessionID":"c121d901-22dc-40ec-8562-4aefaccc893b","UserID":"aa819828-78b1-4007-96d4-49113fdf5ef6")

    Unfortunately, the only way to do is this through groovy scripting. You can create a groovy script after your test request, read the value of session id and use basic string - substring function to get session id and use it as per your needs.

    Regards,
    Deepesh Jain