Unable to Scroll page

Hello Team,

Kindly assist me how will tool capture scroll option. because recorded scenario gets stuck on scroll option

Thanks

Rammurti pal

‘Scroll’ behavior can’t be captured because actually it does not interact with current web page application but browser instead.

You can manually add ‘Scroll’ action after recorded test case is generated.

hi

am using web applications but still unable to scroll please assist how to add steps for scroll page

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://global.crs.org/_auth/Logon.aspx?ru=aHR0cHM6Ly9nbG9iYWwuY3JzLm9yZy8=’)

WebUI.setText(findTestObject(‘Page_Logon (1)/input_LogonWidget1SSO_2’), ‘rpal’)

WebUI.setText(findTestObject(‘Page_Logon (1)/input_LogonWidget1SSO_3’), ‘Password@2’)

WebUI.click(findTestObject(‘Page_Logon (1)/input_LogonWidget1ssoLoginButt’))

WebUI.click(findTestObject(‘Page_Global Home (1)/div_s4-workspace’))

WebUI.click(findTestObject(‘Page_Global Home (1)/div_s4-workspace’))

WebUI.click(findTestObject(‘Page_Global Home (1)/div_s4-workspace’))

WebUI.click(findTestObject(‘Page_Global Home (1)/span_CRS Worldwide’))

WebUI.click(findTestObject(‘Page_Worldwide Site Directory/div_s4-workspace’))

WebUI.click(findTestObject(‘Page_Worldwide Site Directory/a_CRS Region’))

WebUI.click(findTestObject(‘Page_Worldwide Site Directory/div_s4-workspace’))

WebUI.click(findTestObject(‘Page_Worldwide Site Directory/a_Niger’))

WebUI.click(findTestObject(‘Page_Niger/div_s4-workspace’))

WebUI.click(findTestObject(‘Page_Niger/span_Pal Rammurti’))

WebUI.click(findTestObject(‘Page_Niger/span_Sign Out’))

WebUI.closeBrowser()

Your current test steps don’t have any ‘Scroll To’ step, so please add it first.

Hi,

Unable to move ahead after inserting the “Scroll to element”.

getting some error see the attached screenshot

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

import org.openqa.selenium.Keys as Keys

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://global.crs.org/_auth/Logon.aspx?ru=aHR0cHM6Ly9nbG9iYWwuY3JzLm9yZy8=’)

WebUI.setText(findTestObject(‘Page_Logon/input_LogonWidget1SSO_2’), ‘rpal’)

WebUI.setText(findTestObject(‘Page_Logon/input_LogonWidget1SSO_3’), ‘Password@2’)

WebUI.click(findTestObject(‘Page_Logon/input_LogonWidget1ssoLoginButt’))

WebUI.scrollToElement(findTestObject(‘Page_Global Home/div_s4-workspace’), 300)

WebUI.click(findTestObject(‘Page_Global Home/span_CRS Worldwide’))

WebUI.click(findTestObject(‘Page_Worldwide Site Directory/div_s4-workspace’))

WebUI.click(findTestObject(‘Page_Worldwide Site Directory/a_CRS Region’))

WebUI.click(findTestObject(‘Page_Worldwide Site Directory/a_Benin’))

WebUI.click(findTestObject(‘Page_Benin/span_Pal Rammurti’))

WebUI.click(findTestObject(‘Page_Benin/span_zz8_ID_Logout’))

WebUI.closeBrowser()

2018-01-04_15-18-28.jpg

@rpal: I don’t see the error screenshot. Have you still faced with this issue?

Hi ,
Can any one please tell me whats the script for scroll a web page, by using katalon studio

I often using

WebUI.scrollToPosition(0, 0)orWebUI.scrollToElement(findTestObject('btn_refreshTable'), 15)

hi,
When I use scrollToElement, it does not scroll and execution ends abruptly that web element is not found. Can anyone please help?

@6432-tamanna
Try providing some wait before scroll. Just provide Thread.sleep(5000) before scroll step for troubleshooting and check if it is working. If yes, you can use better wait conditions accordingly.

Amit Kumar said:

@6432-tamanna
Try providing some wait before scroll. Just provide Thread.sleep(5000) before scroll step for troubleshooting and check if it is working. If yes, you can use better wait conditions accordingly.

It worked for some pages… thanks!

Hi all,
Has anyone ever been in a situation like this:

when I use ‘scroll to a position’, page will slides, but it doesn’t exactly slide to that position, so I can’t click the button on that page.

I have been troubled by this problem for a long time, anyone can help? thanks.

I am having the same issue. It is scrolling but not to the expected object. so it is not able clicking.
Can anyone has any advise?
I kept the wait before scroll too.

@kmeenakshi Where do you “stop” your scroll? Do you scroll to the specific element or do you scroll to an element above the specific element? Also, is the specific element at the bottom of the web page?

Thanks for the reply.

I scroll to the specific element but it is just passing that element. I need to click on the Launch button which has the unique xpath , just in the place of the red box.

below 3 lines are the specific code I am using for this.

WebUI.delay(10)
WebUI.scrollToElement(findTestObject(‘Object Repository/Page_myWorld - My Account/button_Launch’), 30, FailureHandling.STOP_ON_FAILURE)
WebUI.click(findTestObject(‘Object Repository/Page_myWorld - My Account/button_Launch’))

@kmeenakshi What I was going to suggest is to “stop” the scroll to an element that is above the specific element (by one or two positions) so that the specific element is in the main viewing area. I have been doing this almost since starting with KS.

1 Like

Thank you so much, it worked but clicking on the above element means, above elements are not guaranteed to be exist in future runs. so is there any other alternate for this?