Welcome › Forums › General PowerShell Q&A › How to get the scroll into view to work in Chrome. Using selenium web driver
- This topic has 2 replies, 2 voices, and was last updated 5 months ago by
Participant.
-
AuthorPosts
-
-
August 22, 2020 at 5:03 pm #251912
I need to scroll down the page to the NEXT button. Only when the NEXT button is visible it can be clicked on. So I need to get the “scroll into view” to work.
PowerShell123456789101112$browser = Start-SeChrome$browser.Navigate().GoToURL($url)ForEach ($A_Element in (Find-SeElement -Driver $browser -TagName a)){If ($A_Element.Text -Notlike "Next"){Conitnue}$A_Element.ScrollIntoView()#Invoke-SeClick -Element $A_Element#$A_Element.Click()sleep 2Break} -
August 24, 2020 at 11:45 am #252152
The only thing I see in the code is that ‘Continue’ is spelled incorrectly.
PowerShell1If ($A_Element.Text -Notlike "Next"){Conitnue}Outside of that, you many need to find a forum specifically for Selenium as asking about usage is a bit to broad of an audience.
-
August 24, 2020 at 12:46 pm #252161
The only thing I see in the code is that ‘Continue’ is spelled incorrectly.
PowerShell
<textarea class=”urvanov-syntax-highlighter-plain print-no” style=”-moz-tab-size: 4; font-size: 14px !important; line-height: 18px !important; z-index: 0; opacity: 0;” readonly=”readonly” data-settings=”dblclick”>If ($A_Element.Text -Notlike “Next”){Conitnue} </textarea>1If ($A_Element.Text -Notlike “Next”){Conitnue}Outside of that, you many need to find a forum specifically for Selenium as asking about usage is a bit to broad of an audience.
Yes sorry for the CONTINUE. This code is part of a larger code, so I had to put in just the lines that were relevant and messed up the continue. That was not the cause of concern through. It was the ScrollIntoView() that was the problem.
I did go through other sites and I did find scripts in other languages for the same issue, but I was not able to convert them to powershell or get the necessary component to run correctly … Like:
https://sqa.stackexchange.com/questions/9655/not-able-to-scroll-down-page-using-selenium-webdriver
https://intellipaat.com/community/16503/how-to-scroll-to-element-with-selenium-webdriver-using-c
-
-
AuthorPosts
- The topic ‘How to get the scroll into view to work in Chrome. Using selenium web driver’ is closed to new replies.