Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to load testing of webmethod (.asmx) #1061

Closed
ranznaorem opened this issue Aug 7, 2019 · 1 comment
Closed

unable to load testing of webmethod (.asmx) #1061

ranznaorem opened this issue Aug 7, 2019 · 1 comment

Comments

@ranznaorem
Copy link

ranznaorem commented Aug 7, 2019

Description of issue

I have a web method/webservice (.aspx/asmx) which is implemented with [WebMethod]. I tried to test the webmethod call "GetItemDetailsTest" using using HTTP POST but I am not able to test as all requests are failed in statistics. Does Locust support webservice/webmethod call?

Expected behavior

web method executed

Actual behavior

request failed

Environment settings

  • OS: Windows
  • Python version: python-3.7.4-amd64
  • Locust version: 0.11.0

Steps to reproduce (for bug reports)

asmx (written with C# and asp.net):
http://192.168.1.155/clientmodule45/Inventory/Inventory.aspx
Method in Server (written with C# and asp.net):
[WebMethod(EnableSession = true)]
[System.Web.Script.Services.ScriptMethod(ResponseFormat = ResponseFormat.Json, XmlSerializeString = false, UseHttpGet = true)]
public static int GetItemDetailsTest(int ItemId)
{
return 101;
}

Script to test WebMethod (locustfile.py):

from locust import HttpLocust, TaskSet, task

class LoginWithUniqueUsersSteps(TaskSet):
@task
def UpdateUserSession(self):
self.client.post("/GetItemDetailsTest", {
'ItemId': '1234'
})

class LoginWithUniqueUsersTest(HttpLocust):
task_set = LoginWithUniqueUsersSteps
host = "http://192.168.1.155/clientmodule45/Inventory/Inventory.aspx"
sock = None

def __init__(self):
    super(LoginWithUniqueUsersTest, self).__init__()
@cgoldberg
Copy link
Member

Please use the Slack channel for general questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants