RequestsLibrary support parallel execute suites with pabot?
up vote
0
down vote
favorite
My project using RequestsLibrary to do interface automation, and all interface calls share a session, which is the session generated by the [Create Session] function.
On this basic, we want to do concurrency, using pabot, and the way we want to use is: all multi-threads share a session for concurrency, so the [Create Session] function is currently called only once, and then all threads share the session.
The session can be retrieved from multithreads in my test , but when the interface is invoked, it is found that other thread interface requests fail:
error messages:
KEYWORD RequestsLibrary . Get Request ${agent.session}, ${uri}, headers=${header}, timeout=${timeout}
Documentation:
Send a GET request on the session object found using the
Start / End / Elapsed: 20181109 15:06:36.520 / 20181109 15:06:36.523 / 00:00:00.003
15:06:36.523 FAIL Non-existing index or alias 'adminsession'.
So I would like to ask if we support concurrent scenarios?
python parallel-processing request robotframework
add a comment |
up vote
0
down vote
favorite
My project using RequestsLibrary to do interface automation, and all interface calls share a session, which is the session generated by the [Create Session] function.
On this basic, we want to do concurrency, using pabot, and the way we want to use is: all multi-threads share a session for concurrency, so the [Create Session] function is currently called only once, and then all threads share the session.
The session can be retrieved from multithreads in my test , but when the interface is invoked, it is found that other thread interface requests fail:
error messages:
KEYWORD RequestsLibrary . Get Request ${agent.session}, ${uri}, headers=${header}, timeout=${timeout}
Documentation:
Send a GET request on the session object found using the
Start / End / Elapsed: 20181109 15:06:36.520 / 20181109 15:06:36.523 / 00:00:00.003
15:06:36.523 FAIL Non-existing index or alias 'adminsession'.
So I would like to ask if we support concurrent scenarios?
python parallel-processing request robotframework
Do you have a Minimal, Complete, and Verifiable example for the observed result. Right now there is quite a bit of room for interpretation that a good robot and pabot example would help clarify.
– A. Kootstra
Nov 9 at 8:32
@A. Kootstra I submitted a code using request and pabot https://github.com/Huanxin-leolil/request_pabot , when I executepabot.bat --pabotlib --processes 2 C:Usersleogitrequest_pabot
. One of the threads failed to execute ERROR MESSAGE:Non-existing index or alias 'github'.
– leoli
Nov 11 at 5:10
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My project using RequestsLibrary to do interface automation, and all interface calls share a session, which is the session generated by the [Create Session] function.
On this basic, we want to do concurrency, using pabot, and the way we want to use is: all multi-threads share a session for concurrency, so the [Create Session] function is currently called only once, and then all threads share the session.
The session can be retrieved from multithreads in my test , but when the interface is invoked, it is found that other thread interface requests fail:
error messages:
KEYWORD RequestsLibrary . Get Request ${agent.session}, ${uri}, headers=${header}, timeout=${timeout}
Documentation:
Send a GET request on the session object found using the
Start / End / Elapsed: 20181109 15:06:36.520 / 20181109 15:06:36.523 / 00:00:00.003
15:06:36.523 FAIL Non-existing index or alias 'adminsession'.
So I would like to ask if we support concurrent scenarios?
python parallel-processing request robotframework
My project using RequestsLibrary to do interface automation, and all interface calls share a session, which is the session generated by the [Create Session] function.
On this basic, we want to do concurrency, using pabot, and the way we want to use is: all multi-threads share a session for concurrency, so the [Create Session] function is currently called only once, and then all threads share the session.
The session can be retrieved from multithreads in my test , but when the interface is invoked, it is found that other thread interface requests fail:
error messages:
KEYWORD RequestsLibrary . Get Request ${agent.session}, ${uri}, headers=${header}, timeout=${timeout}
Documentation:
Send a GET request on the session object found using the
Start / End / Elapsed: 20181109 15:06:36.520 / 20181109 15:06:36.523 / 00:00:00.003
15:06:36.523 FAIL Non-existing index or alias 'adminsession'.
So I would like to ask if we support concurrent scenarios?
python parallel-processing request robotframework
python parallel-processing request robotframework
asked Nov 9 at 8:23
leoli
32
32
Do you have a Minimal, Complete, and Verifiable example for the observed result. Right now there is quite a bit of room for interpretation that a good robot and pabot example would help clarify.
– A. Kootstra
Nov 9 at 8:32
@A. Kootstra I submitted a code using request and pabot https://github.com/Huanxin-leolil/request_pabot , when I executepabot.bat --pabotlib --processes 2 C:Usersleogitrequest_pabot
. One of the threads failed to execute ERROR MESSAGE:Non-existing index or alias 'github'.
– leoli
Nov 11 at 5:10
add a comment |
Do you have a Minimal, Complete, and Verifiable example for the observed result. Right now there is quite a bit of room for interpretation that a good robot and pabot example would help clarify.
– A. Kootstra
Nov 9 at 8:32
@A. Kootstra I submitted a code using request and pabot https://github.com/Huanxin-leolil/request_pabot , when I executepabot.bat --pabotlib --processes 2 C:Usersleogitrequest_pabot
. One of the threads failed to execute ERROR MESSAGE:Non-existing index or alias 'github'.
– leoli
Nov 11 at 5:10
Do you have a Minimal, Complete, and Verifiable example for the observed result. Right now there is quite a bit of room for interpretation that a good robot and pabot example would help clarify.
– A. Kootstra
Nov 9 at 8:32
Do you have a Minimal, Complete, and Verifiable example for the observed result. Right now there is quite a bit of room for interpretation that a good robot and pabot example would help clarify.
– A. Kootstra
Nov 9 at 8:32
@A. Kootstra I submitted a code using request and pabot https://github.com/Huanxin-leolil/request_pabot , when I execute
pabot.bat --pabotlib --processes 2 C:Usersleogitrequest_pabot
. One of the threads failed to execute ERROR MESSAGE: Non-existing index or alias 'github'.
– leoli
Nov 11 at 5:10
@A. Kootstra I submitted a code using request and pabot https://github.com/Huanxin-leolil/request_pabot , when I execute
pabot.bat --pabotlib --processes 2 C:Usersleogitrequest_pabot
. One of the threads failed to execute ERROR MESSAGE: Non-existing index or alias 'github'.
– leoli
Nov 11 at 5:10
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
The way that Pabot creates parallel processes is to start multiple independent instances of Robot Framework. In each instance you'll have a separate instantiation of the RequestLibrary. As a consequence of this you'll not be able to share the same session.
Although It is possible to share values from instance to another instance through the pabotlib, this doesn't work for objects. Often an object can be serialized into a string, but sadly the Requests module that RequestsLibrary depends on doesn't support this.
In my view the best approach is to recreate identical sessions across the sessions by reusing the same cookies and other session specific variable via pabotlib.
Thanks. I think I agree with your answer. In my project, I tried to create multiple session in multithreading , and all interface use the cookie by reusing the same cookies is works perfectly in request headers. But I need to refactor all my code, It's more hard for me!
– leoli
Nov 13 at 4:18
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The way that Pabot creates parallel processes is to start multiple independent instances of Robot Framework. In each instance you'll have a separate instantiation of the RequestLibrary. As a consequence of this you'll not be able to share the same session.
Although It is possible to share values from instance to another instance through the pabotlib, this doesn't work for objects. Often an object can be serialized into a string, but sadly the Requests module that RequestsLibrary depends on doesn't support this.
In my view the best approach is to recreate identical sessions across the sessions by reusing the same cookies and other session specific variable via pabotlib.
Thanks. I think I agree with your answer. In my project, I tried to create multiple session in multithreading , and all interface use the cookie by reusing the same cookies is works perfectly in request headers. But I need to refactor all my code, It's more hard for me!
– leoli
Nov 13 at 4:18
add a comment |
up vote
1
down vote
accepted
The way that Pabot creates parallel processes is to start multiple independent instances of Robot Framework. In each instance you'll have a separate instantiation of the RequestLibrary. As a consequence of this you'll not be able to share the same session.
Although It is possible to share values from instance to another instance through the pabotlib, this doesn't work for objects. Often an object can be serialized into a string, but sadly the Requests module that RequestsLibrary depends on doesn't support this.
In my view the best approach is to recreate identical sessions across the sessions by reusing the same cookies and other session specific variable via pabotlib.
Thanks. I think I agree with your answer. In my project, I tried to create multiple session in multithreading , and all interface use the cookie by reusing the same cookies is works perfectly in request headers. But I need to refactor all my code, It's more hard for me!
– leoli
Nov 13 at 4:18
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The way that Pabot creates parallel processes is to start multiple independent instances of Robot Framework. In each instance you'll have a separate instantiation of the RequestLibrary. As a consequence of this you'll not be able to share the same session.
Although It is possible to share values from instance to another instance through the pabotlib, this doesn't work for objects. Often an object can be serialized into a string, but sadly the Requests module that RequestsLibrary depends on doesn't support this.
In my view the best approach is to recreate identical sessions across the sessions by reusing the same cookies and other session specific variable via pabotlib.
The way that Pabot creates parallel processes is to start multiple independent instances of Robot Framework. In each instance you'll have a separate instantiation of the RequestLibrary. As a consequence of this you'll not be able to share the same session.
Although It is possible to share values from instance to another instance through the pabotlib, this doesn't work for objects. Often an object can be serialized into a string, but sadly the Requests module that RequestsLibrary depends on doesn't support this.
In my view the best approach is to recreate identical sessions across the sessions by reusing the same cookies and other session specific variable via pabotlib.
answered Nov 12 at 16:31
A. Kootstra
4,0492932
4,0492932
Thanks. I think I agree with your answer. In my project, I tried to create multiple session in multithreading , and all interface use the cookie by reusing the same cookies is works perfectly in request headers. But I need to refactor all my code, It's more hard for me!
– leoli
Nov 13 at 4:18
add a comment |
Thanks. I think I agree with your answer. In my project, I tried to create multiple session in multithreading , and all interface use the cookie by reusing the same cookies is works perfectly in request headers. But I need to refactor all my code, It's more hard for me!
– leoli
Nov 13 at 4:18
Thanks. I think I agree with your answer. In my project, I tried to create multiple session in multithreading , and all interface use the cookie by reusing the same cookies is works perfectly in request headers. But I need to refactor all my code, It's more hard for me!
– leoli
Nov 13 at 4:18
Thanks. I think I agree with your answer. In my project, I tried to create multiple session in multithreading , and all interface use the cookie by reusing the same cookies is works perfectly in request headers. But I need to refactor all my code, It's more hard for me!
– leoli
Nov 13 at 4:18
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53222111%2frequestslibrary-support-parallel-execute-suites-with-pabot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have a Minimal, Complete, and Verifiable example for the observed result. Right now there is quite a bit of room for interpretation that a good robot and pabot example would help clarify.
– A. Kootstra
Nov 9 at 8:32
@A. Kootstra I submitted a code using request and pabot https://github.com/Huanxin-leolil/request_pabot , when I execute
pabot.bat --pabotlib --processes 2 C:Usersleogitrequest_pabot
. One of the threads failed to execute ERROR MESSAGE:Non-existing index or alias 'github'.
– leoli
Nov 11 at 5:10