I am using Chrome with version 63.0.3239.84 (Official Build) (64-bit) and Katalon Studio 5.2.0.1 on Win 10 Pro (64-bit).
I am testing web page which has a lot of elements.
Elements which are in the visible part of the window are loaded at once, others are hidden and are loaded with the mouse scroll down. I am using Scroll to Position to scroll down but the hidden elements are not shown. I also used Scroll to Element to the element, which is below the hidden elements, but the hidden elements are not shown.
(I tested the same web page with Nightwatch using window.scrollBy() and it shows hidden elements, so the issue is in the Katalon Studio Scroll functions).
Hi Anita,
Scroll To Position or Scroll To Element will execute javascript (arguments[0].scrollIntoView()) to scroll to its position or defined element. Your current web application does trigger showing hidden elements when using this approach, so I would like to take this issue as an improvement and will move this discussion to Features / Suggestions category instead.
Weâre having the same issue. Using lazy loading for the pages; elements will show when the user starts scrolling. In order to verify the presence of the hidden elements, it would be a great advantage if Katalon Studio could simulate this user action.
+1
I am facing the same issueâŚnot able to click on the hidden element when expands the list.
I have tried both scrollToElement() and scrollToPosition() methods.
Please give the solution for this.
Thank You
I am also facing the same issue with ag-grid, Katalon please provide a solution.
We are facing the same issue when using a SPA solution that implements a so called âinfinite scrollâ using devxpress components. I believe this is a very common web solution nowadays so really hoping such a test case can be added to Katalon soon!
I kind of faked it out by scrolling to and element I know is mid page so a lower popup menu to enable clicking on it. Itâs a little cheat, but it did the trick. Maybe you can use this until such time a better solution comes along? I also added some delays so I can see what itâs doing.
Manual verson
Hereâs the script version:
'Scrolling down the page so popup appears. â
WebUI.scrollToElement(findTestObject(âHomepage PopUp Footer/Page_Southern New Hampshire Univers/h2_NewSNHUâ), 3)
WebUI.waitForElementVisible(findTestObject(âHomepage PopUp Footer/Page_Southern New Hampshire Univers/a_Apply Nowâ), 3)
WebUI.click(findTestObject(âObject Repository/Homepage PopUp Footer/Page_Southern New Hampshire Univers/a_Apply Nowâ))
WebUI.delay(2)
WebUI.click(findTestObject(âHomepage PopUp Footer/Page_Southern New Hampshire Univers/a_fancybox-item fancybox-closeâ))
WebUI.delay(2)
WebUI.mouseOver(findTestObject(âHomepage PopUp Footer/Page_Southern New Hampshire Univers/a_Visit SNHUâ), FailureHandling.STOP_ON_FAILURE)
WebUI.click(findTestObject(âHomepage PopUp Footer/Page_Southern New Hampshire Univers/a_Visit SNHUâ))
I am also facing the same issue.
Anita said:
I am using Chrome with version 63.0.3239.84 (Official Build) (64-bit) and Katalon Studio 5.2.0.1 on Win 10 Pro (64-bit).
I am testing web page which has a lot of elements.
Elements which are in the visible part of the window are loaded at once, others are hidden and are loaded with the mouse scroll down. I am using Scroll to Position to scroll down but the hidden elements are not shown. I also used Scroll to Element to the element, which is below the hidden elements, but the hidden elements are not shown.
(I tested the same web page with Nightwatch using window.scrollBy() and it shows hidden elements, so the issue is in the Katalon Studio Scroll functions).
Hi Anita. Can you give an example AUT where this issue presents ? We are investigating this and I am wondering if your hidden elements, before being scrolled to, are already present on the page, or simply pop into existence.
Since the keyword ScrollToPosition merely emulates scrolling some amount of offsets, it is AUT-dependent whether or not such an action reveals hidden elements. I havenât tried the aforementioned Nightwatch window.scrollBy() yet, but I think you can accomplish that by this answer. Once we understand the problem clearly we will determine if the improvement should be considered in upcoming releases.
This issue has been acknowledged and logged to Github.
Please follow up its status here: https://github.com/katalon-studio/katalon-studio/issues/10
Thanh To said:
Anita said:
I am using Chrome with version 63.0.3239.84 (Official Build) (64-bit) and Katalon Studio 5.2.0.1 on Win 10 Pro (64-bit).
I am testing web page which has a lot of elements.
Elements which are in the visible part of the window are loaded at once, others are hidden and are loaded with the mouse scroll down. I am using Scroll to Position to scroll down but the hidden elements are not shown. I also used Scroll to Element to the element, which is below the hidden elements, but the hidden elements are not shown.
(I tested the same web page with Nightwatch using window.scrollBy() and it shows hidden elements, so the issue is in the Katalon Studio Scroll functions).Hi Anita. Can you give an example AUT where this issue presents ? We are investigating this and I am wondering if your hidden elements, before being scrolled to, are already present on the page, or simply pop into existence.
Since the keyword ScrollToPosition merely emulates scrolling some amount of offsets, it is AUT-dependent whether or not such an action reveals hidden elements. I havenât tried the aforementioned Nightwatch window.scrollBy() yet, but I think you can accomplish that by this answer. Once we understand the problem clearly we will determine if the improvement should be considered in upcoming releases.
Hi,
the hidden elements are not present on the page, they pop into existence when you scroll to the bottom of the page.
Currently, we are using next workaround
for (def j : (1..20)) {
WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.PAGE_DOWN))
}
which loads the hidden elements and works fine for us.
Anita said:
Thanh To said:
Anita said:
I am using Chrome with version 63.0.3239.84 (Official Build) (64-bit) and Katalon Studio 5.2.0.1 on Win 10 Pro (64-bit).
I am testing web page which has a lot of elements.
Elements which are in the visible part of the window are loaded at once, others are hidden and are loaded with the mouse scroll down. I am using Scroll to Position to scroll down but the hidden elements are not shown. I also used Scroll to Element to the element, which is below the hidden elements, but the hidden elements are not shown.
(I tested the same web page with Nightwatch using window.scrollBy() and it shows hidden elements, so the issue is in the Katalon Studio Scroll functions).Hi Anita. Can you give an example AUT where this issue presents ? We are investigating this and I am wondering if your hidden elements, before being scrolled to, are already present on the page, or simply pop into existence.
Since the keyword ScrollToPosition merely emulates scrolling some amount of offsets, it is AUT-dependent whether or not such an action reveals hidden elements. I havenât tried the aforementioned Nightwatch window.scrollBy() yet, but I think you can accomplish that by this answer. Once we understand the problem clearly we will determine if the improvement should be considered in upcoming releases.
Hi,
the hidden elements are not present on the page, they pop into existence when you scroll to the bottom of the page.
Currently, we are using next workaroundfor (def j : (1..20)) { WebUI.sendKeys(findTestObject(null), Keys.chord(Keys.PAGE_DOWN)) }
which loads the hidden elements and works fine for us.
Hi Anita.
I see why ScrollToElement doesnât work because thereâs no element present yet to scroll to, but I tested ScrollToPosition on AirBnB which only loads elements as users scroll down too - seems to be similar to your AUT, and it works fine, as in it successfully loads element as the page moves down.
ScrollToPosition will execute Javascript: window.scrollTo(x,y) where x,y are the desired coordinates. Could you test it with a coordinates far down enough to see if it could accomplish the same thing as your workaround ? Itâd be best if you could provide us with a GIF or a video to reproduce this issue.
Thanks a lot !
Hello all,
I faced this because development team using Lazy loading , so not all elements are loaded once the page is opened .
so you need to scroll until element present to verify a hidden element âNot loaded yetâ.
I implemented following solution ,
1- you need to use Custom Keywords .
2- import following Java Libraries :
-
import java.awt.Robot;
-
import java.awt.event.InputEvent;
3- Create Scroll Until element present Method as below :
@Keyword
def ScrollUntilElementPresent(String ObjectRepositoryPath) {def b = 1 for (def i = 0; i <b; i++) { def Status = WebUI.verifyElementPresent(findTestObject(ObjectRepositoryPath), 0, FailureHandling.OPTIONAL) if (Status == false ) { Robot robot = new Robot(); robot.mouseWheel(8) b++ } } WebUI.scrollToElement(findTestObject(ObjectRepositoryPath), 0) WebUI.mouseOver(findTestObject(ObjectRepositoryPath))
}
4 - Now back to your script and use above method as below :
CustomKeywords.âShahid.ScrollUntilElementPresentâ(âCategories/Movies/Main Movies Page/firstMovieBundleâ)
5- Now you have your own ScrollUntilElementPresent Method .
Hopes this will help .
Thank for you help, i can scroll down success.
But now i have problem to scroll up.
Can you help my, pls?
Hi @vien.dat
Instead of
robot.mouseWheel(8)
Try
robot.mouseWheel(-8)
Youâd probably also need to change the condition. If youâre scrolling up from where you previously scrolled down, then you would need to change the condition to checking if the element on the top of the page is visible with WebUI.verifyElementVisible
Thank you so much, i will try it.