How to fix “could not be scrolled into view” error In Selenium? [duplicate]












0
















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
lang_57 medium_font" href="javascript:;">
could not be scrolled into
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();









share|improve this question















marked as duplicate by NarendraR, DebanjanB selenium
Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

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.























    0
















    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
    lang_57 medium_font" href="javascript:;">
    could not be scrolled into
    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();









    share|improve this question















    marked as duplicate by NarendraR, DebanjanB selenium
    Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

    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.





















      0












      0








      0









      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
      lang_57 medium_font" href="javascript:;">
      could not be scrolled into
      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();









      share|improve this question

















      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
      lang_57 medium_font" href="javascript:;">
      could not be scrolled into
      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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 selenium
      Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

      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 selenium
      Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

      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.


























          1 Answer
          1






          active

          oldest

          votes


















          2














          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!






          share|improve this answer






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            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!






            share|improve this answer




























              2














              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!






              share|improve this answer


























                2












                2








                2







                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!






                share|improve this answer













                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!







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 2 at 10:30









                Ratmir AsanovRatmir Asanov

                3,61731025




                3,61731025

















                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas