How to fix “could not be scrolled into view” error In Selenium? [duplicate]
This question already has an answer here:
Selenium web driver: cannot be scrolled into view
4 answers
I'm using Selenium to automate an application but when I tried to click on an <a>
tag, It throws below error:
Element
<a id="play_button" class="clickable myButton margin_t15
could not be scrolled into
lang_57 medium_font" href="javascript:;">
view.
I'm using Selenium with C# and Firefox V62!
Also, I know that the element is hidden, and it will appear 5 seconds after loading the web page! Now how can I fix this error?
I also tried by.xpath(), by.name()
and too many methods like these!
Here is my code:
IWebDriver driver = new FirefoxDriver();
driver.Url = "The Web Site";
driver.FindElement(By.Id("play_button")).Click();
c# selenium selenium-webdriver webdriver
marked as duplicate by NarendraR, DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 2 at 13:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Selenium web driver: cannot be scrolled into view
4 answers
I'm using Selenium to automate an application but when I tried to click on an <a>
tag, It throws below error:
Element
<a id="play_button" class="clickable myButton margin_t15
could not be scrolled into
lang_57 medium_font" href="javascript:;">
view.
I'm using Selenium with C# and Firefox V62!
Also, I know that the element is hidden, and it will appear 5 seconds after loading the web page! Now how can I fix this error?
I also tried by.xpath(), by.name()
and too many methods like these!
Here is my code:
IWebDriver driver = new FirefoxDriver();
driver.Url = "The Web Site";
driver.FindElement(By.Id("play_button")).Click();
c# selenium selenium-webdriver webdriver
marked as duplicate by NarendraR, DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 2 at 13:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Selenium web driver: cannot be scrolled into view
4 answers
I'm using Selenium to automate an application but when I tried to click on an <a>
tag, It throws below error:
Element
<a id="play_button" class="clickable myButton margin_t15
could not be scrolled into
lang_57 medium_font" href="javascript:;">
view.
I'm using Selenium with C# and Firefox V62!
Also, I know that the element is hidden, and it will appear 5 seconds after loading the web page! Now how can I fix this error?
I also tried by.xpath(), by.name()
and too many methods like these!
Here is my code:
IWebDriver driver = new FirefoxDriver();
driver.Url = "The Web Site";
driver.FindElement(By.Id("play_button")).Click();
c# selenium selenium-webdriver webdriver
This question already has an answer here:
Selenium web driver: cannot be scrolled into view
4 answers
I'm using Selenium to automate an application but when I tried to click on an <a>
tag, It throws below error:
Element
<a id="play_button" class="clickable myButton margin_t15
could not be scrolled into
lang_57 medium_font" href="javascript:;">
view.
I'm using Selenium with C# and Firefox V62!
Also, I know that the element is hidden, and it will appear 5 seconds after loading the web page! Now how can I fix this error?
I also tried by.xpath(), by.name()
and too many methods like these!
Here is my code:
IWebDriver driver = new FirefoxDriver();
driver.Url = "The Web Site";
driver.FindElement(By.Id("play_button")).Click();
This question already has an answer here:
Selenium web driver: cannot be scrolled into view
4 answers
c# selenium selenium-webdriver webdriver
c# selenium selenium-webdriver webdriver
edited Jan 2 at 10:31
Ratmir Asanov
3,61731025
3,61731025
asked Jan 2 at 10:22
Arash moghadasArash moghadas
34
34
marked as duplicate by NarendraR, DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 2 at 13:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by NarendraR, DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 2 at 13:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can use the following code to fix the problem:
IJavascriptExecutor js = (IJavascriptExecutor) driver;
button = river.FindElement(By.Id("play_button"));
jse.executeScript("arguments[0].scrollIntoView(true);", button);
button.Click()
PS: You can also use explicit wait to be clickable the element and after that click on it.
Hope it helps you!
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use the following code to fix the problem:
IJavascriptExecutor js = (IJavascriptExecutor) driver;
button = river.FindElement(By.Id("play_button"));
jse.executeScript("arguments[0].scrollIntoView(true);", button);
button.Click()
PS: You can also use explicit wait to be clickable the element and after that click on it.
Hope it helps you!
add a comment |
You can use the following code to fix the problem:
IJavascriptExecutor js = (IJavascriptExecutor) driver;
button = river.FindElement(By.Id("play_button"));
jse.executeScript("arguments[0].scrollIntoView(true);", button);
button.Click()
PS: You can also use explicit wait to be clickable the element and after that click on it.
Hope it helps you!
add a comment |
You can use the following code to fix the problem:
IJavascriptExecutor js = (IJavascriptExecutor) driver;
button = river.FindElement(By.Id("play_button"));
jse.executeScript("arguments[0].scrollIntoView(true);", button);
button.Click()
PS: You can also use explicit wait to be clickable the element and after that click on it.
Hope it helps you!
You can use the following code to fix the problem:
IJavascriptExecutor js = (IJavascriptExecutor) driver;
button = river.FindElement(By.Id("play_button"));
jse.executeScript("arguments[0].scrollIntoView(true);", button);
button.Click()
PS: You can also use explicit wait to be clickable the element and after that click on it.
Hope it helps you!
answered Jan 2 at 10:30
Ratmir AsanovRatmir Asanov
3,61731025
3,61731025
add a comment |
add a comment |