'Str' Object has no attribute 'get_Client' #3165
Replies: 6 comments 7 replies
-
|
Hi! I dont know what the first issue is - can I see the full callstack? For the second issue, you should probably just do read mode, so remove the w: |
Beta Was this translation helpful? Give feedback.
-
|
`File "/Users/nicholas/PycharmProjects/RevMediaGroupApps/.venv/lib/python3.12/site-packages/locust/user/task.py", line 490, in execute_task [2025-07-09 16:28:16,432] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:17,727] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:18,816] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:20,739] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:22,429] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:23,572] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:25,339] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:26,451] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:28,109] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:29,878] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:30,984] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:32,832] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:34,428] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:35,530] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:36,982] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:38,151] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:39,462] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:40,657] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:41,846] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:43,774] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:45,403] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:47,094] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:48,865] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:50,462] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:51,749] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:53,461] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:55,250] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:56,657] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:58,544] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:28:59,754] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' [2025-07-09 16:29:01,527] RMG-NICHOLAS/ERROR/locust.user.task: 'str' object has no attribute 'get_client' |
Beta Was this translation helpful? Give feedback.
-
|
Ah. Now I see it. Here is your problem: I dont know what you were trying to do but client_pool definitely can't be a string :) |
Beta Was this translation helpful? Give feedback.
-
|
Hi Cyberw, Thanks for your reply. It worked now. How to instantiate new client_pool and assign it to variable. |
Beta Was this translation helpful? Give feedback.
-
|
I just want a simple client pool and assign to the variable. Thats it. Please help. Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
I just want to learn locust in depth. That;s all and not customize client_pool behviour. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear all forumers, I coded a generic stress testing locust file and it will send out email report after test stop but it prompt out this error message and I don't know how to solve it.
`class rmgWebSiteUser(FastHttpUser):
wait_time = between(1, 2)
client_pool = "myconnpool"
concurrency = 100000
connection_timeout = 60.0
max_retries = 3
network_timeout = 60
EmailManager.py
class sendReportManager:
def sendEmail(self):
# Email settings
EMAIL_FROM = "[email protected]"
EMAIL_TO = ["[email protected]", "[email protected]", "[email protected]"]
EMAIL_SUBJECT = f"Locust Load Test Report"
EMAIL_BODY = "Attached is the HTML load test report generated by Locust."
Questions:
File "/Users/nicholas/PycharmProjects/RevMediaGroupApps/emailManager.py", line 23, in sendEmail
with open("report.html", "rw") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: must have exactly one of create/read/write/append mode
`
Beta Was this translation helpful? Give feedback.
All reactions