Forum Discussion

viki3110's avatar
viki3110
Senior Member
6 years ago

Getting 404 using Groovy but works well with manual hit

Can someone help me on -

i am trying to run a test step ( in the same testSuite)  using groovy script, the teststeps is executing but its failing and giving 404 

whereas when doing a manul hit on the test step , its passing.

i tried putting waiting time but it did not help me.

 

I am using below steps to run a test step

def val = testRunner.testCase.testSuite.getTestCaseByName("ABC").getTestStepByName("XYZ")

val.run(testRunner, context)

  • Hi viki3110 ,

     

    Can you please share any screenshot of request and response, because the syntax you are using seems correct to me.

     

    • JHunt's avatar
      JHunt
      Community Hero

      Probably something to do with the context you are running the test under. I may be able to help but you'll need to post your project.

       

      Make a copy of your project.

      Open the copy and delete anything not related to this problem.

      Create a mock service for the interface you are having problems with.

      Set the end point for the failing test case to the mock service.

      Make sure you can reproduce the issue against the mock service.

      Post the project here as an attachment.