Python+Selenium: Is it possible to lock the browser from manual clicks and inputs?
I have written a python selenium code which automates actions on a website. Once user authenticates the log in, selenium takes over the browser and does its thing. Everything works perfectly fine, however, I notice that the code may fail if user accidentally clicks anything on any links while selenium is running.
Is there a way to prevent manual inputs from the user? something like:
br = webdriver.chrome()
br.lock_manual_userinput()
python python-2.7 selenium selenium-webdriver
add a comment |
I have written a python selenium code which automates actions on a website. Once user authenticates the log in, selenium takes over the browser and does its thing. Everything works perfectly fine, however, I notice that the code may fail if user accidentally clicks anything on any links while selenium is running.
Is there a way to prevent manual inputs from the user? something like:
br = webdriver.chrome()
br.lock_manual_userinput()
python python-2.7 selenium selenium-webdriver
1
Not sure if its an option, but you can hide the browser instead.
– Sean Breckenridge
Mar 11 '18 at 8:26
add a comment |
I have written a python selenium code which automates actions on a website. Once user authenticates the log in, selenium takes over the browser and does its thing. Everything works perfectly fine, however, I notice that the code may fail if user accidentally clicks anything on any links while selenium is running.
Is there a way to prevent manual inputs from the user? something like:
br = webdriver.chrome()
br.lock_manual_userinput()
python python-2.7 selenium selenium-webdriver
I have written a python selenium code which automates actions on a website. Once user authenticates the log in, selenium takes over the browser and does its thing. Everything works perfectly fine, however, I notice that the code may fail if user accidentally clicks anything on any links while selenium is running.
Is there a way to prevent manual inputs from the user? something like:
br = webdriver.chrome()
br.lock_manual_userinput()
python python-2.7 selenium selenium-webdriver
python python-2.7 selenium selenium-webdriver
edited Mar 11 '18 at 8:17
James Z
11.2k71935
11.2k71935
asked Mar 11 '18 at 8:10
Kiran SagarKiran Sagar
115
115
1
Not sure if its an option, but you can hide the browser instead.
– Sean Breckenridge
Mar 11 '18 at 8:26
add a comment |
1
Not sure if its an option, but you can hide the browser instead.
– Sean Breckenridge
Mar 11 '18 at 8:26
1
1
Not sure if its an option, but you can hide the browser instead.
– Sean Breckenridge
Mar 11 '18 at 8:26
Not sure if its an option, but you can hide the browser instead.
– Sean Breckenridge
Mar 11 '18 at 8:26
add a comment |
2 Answers
2
active
oldest
votes
There is no such thing. You can dedicate machine/s with limited access for running the automation or just be carful if you are working while running the scripts.
add a comment |
Selenium is purely used for automating of repeatative Manual Tasks. At this point it is worth to mention that Selenium mocks User Interactions.
Hence the statement once user authenticates the log in, selenium takes over the browser is pretty much speculative as attempting to Reconnect Selenium to previous Browsing Session is not viable.
Now the statement, "code may fail if user accidentally clicks anything" is pretty much expected as Selenium needs browser focus. As a result of any manual user interaction Selenium will loose focus and raise an error.
Finally, there is no other way to prevent manual inputs as mentioned earlier that Selenium mocks User Interactions. The best possible way to execute your Selenium based Automated Tests preventing manual inputs from the user would be to :
- Set up a Test Bed with all the required Hardware and Software configuration.
- Create the Test Bed in an isolated environment preferably in a Test Lab free from Manual Intervention.
Automate only the required usecases which needs no manual intervention.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f49217989%2fpythonselenium-is-it-possible-to-lock-the-browser-from-manual-clicks-and-input%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is no such thing. You can dedicate machine/s with limited access for running the automation or just be carful if you are working while running the scripts.
add a comment |
There is no such thing. You can dedicate machine/s with limited access for running the automation or just be carful if you are working while running the scripts.
add a comment |
There is no such thing. You can dedicate machine/s with limited access for running the automation or just be carful if you are working while running the scripts.
There is no such thing. You can dedicate machine/s with limited access for running the automation or just be carful if you are working while running the scripts.
answered Mar 11 '18 at 8:20
GuyGuy
18.7k72249
18.7k72249
add a comment |
add a comment |
Selenium is purely used for automating of repeatative Manual Tasks. At this point it is worth to mention that Selenium mocks User Interactions.
Hence the statement once user authenticates the log in, selenium takes over the browser is pretty much speculative as attempting to Reconnect Selenium to previous Browsing Session is not viable.
Now the statement, "code may fail if user accidentally clicks anything" is pretty much expected as Selenium needs browser focus. As a result of any manual user interaction Selenium will loose focus and raise an error.
Finally, there is no other way to prevent manual inputs as mentioned earlier that Selenium mocks User Interactions. The best possible way to execute your Selenium based Automated Tests preventing manual inputs from the user would be to :
- Set up a Test Bed with all the required Hardware and Software configuration.
- Create the Test Bed in an isolated environment preferably in a Test Lab free from Manual Intervention.
Automate only the required usecases which needs no manual intervention.
add a comment |
Selenium is purely used for automating of repeatative Manual Tasks. At this point it is worth to mention that Selenium mocks User Interactions.
Hence the statement once user authenticates the log in, selenium takes over the browser is pretty much speculative as attempting to Reconnect Selenium to previous Browsing Session is not viable.
Now the statement, "code may fail if user accidentally clicks anything" is pretty much expected as Selenium needs browser focus. As a result of any manual user interaction Selenium will loose focus and raise an error.
Finally, there is no other way to prevent manual inputs as mentioned earlier that Selenium mocks User Interactions. The best possible way to execute your Selenium based Automated Tests preventing manual inputs from the user would be to :
- Set up a Test Bed with all the required Hardware and Software configuration.
- Create the Test Bed in an isolated environment preferably in a Test Lab free from Manual Intervention.
Automate only the required usecases which needs no manual intervention.
add a comment |
Selenium is purely used for automating of repeatative Manual Tasks. At this point it is worth to mention that Selenium mocks User Interactions.
Hence the statement once user authenticates the log in, selenium takes over the browser is pretty much speculative as attempting to Reconnect Selenium to previous Browsing Session is not viable.
Now the statement, "code may fail if user accidentally clicks anything" is pretty much expected as Selenium needs browser focus. As a result of any manual user interaction Selenium will loose focus and raise an error.
Finally, there is no other way to prevent manual inputs as mentioned earlier that Selenium mocks User Interactions. The best possible way to execute your Selenium based Automated Tests preventing manual inputs from the user would be to :
- Set up a Test Bed with all the required Hardware and Software configuration.
- Create the Test Bed in an isolated environment preferably in a Test Lab free from Manual Intervention.
Automate only the required usecases which needs no manual intervention.
Selenium is purely used for automating of repeatative Manual Tasks. At this point it is worth to mention that Selenium mocks User Interactions.
Hence the statement once user authenticates the log in, selenium takes over the browser is pretty much speculative as attempting to Reconnect Selenium to previous Browsing Session is not viable.
Now the statement, "code may fail if user accidentally clicks anything" is pretty much expected as Selenium needs browser focus. As a result of any manual user interaction Selenium will loose focus and raise an error.
Finally, there is no other way to prevent manual inputs as mentioned earlier that Selenium mocks User Interactions. The best possible way to execute your Selenium based Automated Tests preventing manual inputs from the user would be to :
- Set up a Test Bed with all the required Hardware and Software configuration.
- Create the Test Bed in an isolated environment preferably in a Test Lab free from Manual Intervention.
Automate only the required usecases which needs no manual intervention.
edited Nov 24 '18 at 7:50
answered Mar 11 '18 at 11:04
DebanjanBDebanjanB
41.8k84079
41.8k84079
add a comment |
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.
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%2f49217989%2fpythonselenium-is-it-possible-to-lock-the-browser-from-manual-clicks-and-input%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
1
Not sure if its an option, but you can hide the browser instead.
– Sean Breckenridge
Mar 11 '18 at 8:26