I'd like to do a load test over my NLP web app using Locust. The website is simple where users only need to pass in their text and its language type, and then the results will show on the next page.
Therefore, I want to make my "locusts" to first pass in two values on the index page and then go to the corresponding page, which is supposed to be quick and easy. But my code doesn't work and the error message wrote there was something wrong with GET POST method (HTTP 405 & HTTP 500 error). Can anyone help me check my code?
from locust import HttpUser, TaskSet, between, task, SequentialTaskSet
class UserBehavior(SequentialTaskSet):
@task
def submit(self):
self.client.post('/', {'text': 'Kobe Bryant is the best NBA player.', 'language': 'en'})
@task
def get_boto(self):
self.client.get('/boto')
class WebsiteUser(HttpUser):
tasks = [UserBehavior]
wait_time = between(1, 2)