'ElementNotVisibleException' Unable to click button with Selenium
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
A rather 'tricky' question that makes my head spin. I'm unable to click a button while using Selenium.
Css selector property: ValidateOrderForm > span > button
Xpath: #//*[@id="ValidateOrderForm"]/span/button
Attempts:
d.find_elements_by_xpath('ValidateOrderForm')[1].clear()
d.find_elements_by_id('ValidateOrderForm')[0].click()
d.find_element_by_css_selector("button.call-to-action").click()
And really everything in between.
Update: it gives the following error
ElementNotVisibleException: element not interactable
python selenium xpath
|
show 2 more comments
A rather 'tricky' question that makes my head spin. I'm unable to click a button while using Selenium.
Css selector property: ValidateOrderForm > span > button
Xpath: #//*[@id="ValidateOrderForm"]/span/button
Attempts:
d.find_elements_by_xpath('ValidateOrderForm')[1].clear()
d.find_elements_by_id('ValidateOrderForm')[0].click()
d.find_element_by_css_selector("button.call-to-action").click()
And really everything in between.
Update: it gives the following error
ElementNotVisibleException: element not interactable
python selenium xpath
1
Do you get any errors? Or it just doesn't click?
– Lucas Tierney
Nov 15 '18 at 13:43
It gives a ElementNotVisibleException with some attempts
– JayDough
Nov 15 '18 at 13:47
1
Tryprint(len(d.find_elements_by_css_selector("button.call-to-action")))
. Is it1
?
– Andersson
Nov 15 '18 at 13:48
1
That means that you might handle hidden button instead of the one you really need... Try more specific selector, like//span/button[.="Bevestigen"]
... If it also doesn't work, share more HTML (as text, not as image)
– Andersson
Nov 15 '18 at 13:51
1
Can you share the full(er) HTML of the page you are testing?
– Mate Mrše
Nov 15 '18 at 13:51
|
show 2 more comments
A rather 'tricky' question that makes my head spin. I'm unable to click a button while using Selenium.
Css selector property: ValidateOrderForm > span > button
Xpath: #//*[@id="ValidateOrderForm"]/span/button
Attempts:
d.find_elements_by_xpath('ValidateOrderForm')[1].clear()
d.find_elements_by_id('ValidateOrderForm')[0].click()
d.find_element_by_css_selector("button.call-to-action").click()
And really everything in between.
Update: it gives the following error
ElementNotVisibleException: element not interactable
python selenium xpath
A rather 'tricky' question that makes my head spin. I'm unable to click a button while using Selenium.
Css selector property: ValidateOrderForm > span > button
Xpath: #//*[@id="ValidateOrderForm"]/span/button
Attempts:
d.find_elements_by_xpath('ValidateOrderForm')[1].clear()
d.find_elements_by_id('ValidateOrderForm')[0].click()
d.find_element_by_css_selector("button.call-to-action").click()
And really everything in between.
Update: it gives the following error
ElementNotVisibleException: element not interactable
python selenium xpath
python selenium xpath
edited Nov 15 '18 at 13:47
JayDough
asked Nov 15 '18 at 13:36
JayDoughJayDough
417
417
1
Do you get any errors? Or it just doesn't click?
– Lucas Tierney
Nov 15 '18 at 13:43
It gives a ElementNotVisibleException with some attempts
– JayDough
Nov 15 '18 at 13:47
1
Tryprint(len(d.find_elements_by_css_selector("button.call-to-action")))
. Is it1
?
– Andersson
Nov 15 '18 at 13:48
1
That means that you might handle hidden button instead of the one you really need... Try more specific selector, like//span/button[.="Bevestigen"]
... If it also doesn't work, share more HTML (as text, not as image)
– Andersson
Nov 15 '18 at 13:51
1
Can you share the full(er) HTML of the page you are testing?
– Mate Mrše
Nov 15 '18 at 13:51
|
show 2 more comments
1
Do you get any errors? Or it just doesn't click?
– Lucas Tierney
Nov 15 '18 at 13:43
It gives a ElementNotVisibleException with some attempts
– JayDough
Nov 15 '18 at 13:47
1
Tryprint(len(d.find_elements_by_css_selector("button.call-to-action")))
. Is it1
?
– Andersson
Nov 15 '18 at 13:48
1
That means that you might handle hidden button instead of the one you really need... Try more specific selector, like//span/button[.="Bevestigen"]
... If it also doesn't work, share more HTML (as text, not as image)
– Andersson
Nov 15 '18 at 13:51
1
Can you share the full(er) HTML of the page you are testing?
– Mate Mrše
Nov 15 '18 at 13:51
1
1
Do you get any errors? Or it just doesn't click?
– Lucas Tierney
Nov 15 '18 at 13:43
Do you get any errors? Or it just doesn't click?
– Lucas Tierney
Nov 15 '18 at 13:43
It gives a ElementNotVisibleException with some attempts
– JayDough
Nov 15 '18 at 13:47
It gives a ElementNotVisibleException with some attempts
– JayDough
Nov 15 '18 at 13:47
1
1
Try
print(len(d.find_elements_by_css_selector("button.call-to-action")))
. Is it 1
?– Andersson
Nov 15 '18 at 13:48
Try
print(len(d.find_elements_by_css_selector("button.call-to-action")))
. Is it 1
?– Andersson
Nov 15 '18 at 13:48
1
1
That means that you might handle hidden button instead of the one you really need... Try more specific selector, like
//span/button[.="Bevestigen"]
... If it also doesn't work, share more HTML (as text, not as image)– Andersson
Nov 15 '18 at 13:51
That means that you might handle hidden button instead of the one you really need... Try more specific selector, like
//span/button[.="Bevestigen"]
... If it also doesn't work, share more HTML (as text, not as image)– Andersson
Nov 15 '18 at 13:51
1
1
Can you share the full(er) HTML of the page you are testing?
– Mate Mrše
Nov 15 '18 at 13:51
Can you share the full(er) HTML of the page you are testing?
– Mate Mrše
Nov 15 '18 at 13:51
|
show 2 more comments
0
active
oldest
votes
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%2f53320707%2felementnotvisibleexception-unable-to-click-button-with-selenium%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f53320707%2felementnotvisibleexception-unable-to-click-button-with-selenium%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
Do you get any errors? Or it just doesn't click?
– Lucas Tierney
Nov 15 '18 at 13:43
It gives a ElementNotVisibleException with some attempts
– JayDough
Nov 15 '18 at 13:47
1
Try
print(len(d.find_elements_by_css_selector("button.call-to-action")))
. Is it1
?– Andersson
Nov 15 '18 at 13:48
1
That means that you might handle hidden button instead of the one you really need... Try more specific selector, like
//span/button[.="Bevestigen"]
... If it also doesn't work, share more HTML (as text, not as image)– Andersson
Nov 15 '18 at 13:51
1
Can you share the full(er) HTML of the page you are testing?
– Mate Mrše
Nov 15 '18 at 13:51