Unable to scroll down to element

I am unable to scroll down to the save button at the end of the page. Have tried using scrollToElement function but it does not work.

The error given :
Test Cases/merchantAdd1 FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.scrollToElement() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject)

that function have 2 parameters, object and timeout … just set timeout

WebUI.scrollToElement(null, 0)

it works now, thanks for your help! :slight_smile:

Hi, I am new to katalon and I am resolving some real task:

this is my code:

    import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
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.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.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.thoughtworks.selenium.Selenium as Selenium
import org.openqa.selenium.firefox.FirefoxDriver as FirefoxDriver
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium as WebDriverBackedSelenium
import static org.junit.Assert.*
import java.util.regex.Pattern as Pattern
import static org.apache.commons.lang3.StringUtils.join
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.testobject.ConditionType as ConditionType

WebUI.openBrowser('')



WebUI.navigateToUrl('http://helpdesk.exprit.sk/index.do')

WebUI.setText(findTestObject('username_field'), 'admin')

WebUI.setText(findTestObject('pass_field'), 'noileta3')

WebUI.click(findTestObject('login button'))

WebUI.click(findTestObject('external_DB_link'))

WebUI.switchToWindowIndex(1)

WebUI.maximizeWindow()

WebDriver driver = DriverFactory.getWebDriver()

'To locate table'
WebElement Table = driver.findElement(By.xpath('//*[@id="list"]/table'))

'To locate rows of table it will Capture all the rows available in the table'
List<WebElement> rows_table = Table.findElements(By.tagName('tr'))

'To calculate no of rows In table'
int rows_count = rows_table.size()

'Loop will execute for all the rows of the table'
Loop: for (int row = 1; row < rows_count; row++) {
    String xpath = ('//*[@id="list"]/table/tbody/tr[' + row) + ']/td[2]/a'

    TestObject to = new TestObject('objectName')

    to.addProperty('xpath', ConditionType.EQUALS, xpath)
	
		
    WebUI.click(to)
	
	WebUI.scrollToElement(findTestObject('to'), 3)

    WebUI.setText(findTestObject('user_login_input'), 'automaticky anonymizované')

    WebUI.setText(findTestObject('user_meno_input'), 'automaticky anonymizované')

    WebUI.setText(findTestObject('user_priezvisko_input'), 'automaticky anonymizované')

    WebUI.setText(findTestObject('user_email_input'), 'automaticky anonymizované')

    WebUI.setText(findTestObject('user_telefon_input'), 'automaticky anonymizované')
	
	'Select the dropdown value by Select option By Label Method'
	WebUI.selectOptionByLabel(findTestObject('dropdown'), 'Neaktivní', false)
	
	'Verifying the Option is Selected by Label option'
	WebUI.verifyOptionSelectedByLabel(findTestObject('dropdown'), 'Neaktivní', false, 60)

    WebUI.setText(findTestObject('user_heslo_input'), 'automaticky anonymizované')

    WebUI.click(findTestObject('ulozit button'))

    WebUI.back()
}

And this is my result:

    08-20-2019 04:01:53 PM Test Cases/rewriting one by one

Elapsed time: 12,307s

Test Cases/rewriting one by one FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to scroll to object
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
	at com.kms.katalon.core.webui.keyword.builtin.ScrollToElementKeyword.scrollToElement(ScrollToElementKeyword.groovy:88)
	at com.kms.katalon.core.webui.keyword.builtin.ScrollToElementKeyword.execute(ScrollToElementKeyword.groovy:68)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.scrollToElement(WebUiBuiltInKeywords.groovy:2975)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$scrollToElement$5.call(Unknown Source)
	at rewriting one by one.run(rewriting one by one:75)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1566309710204.run(TempTestCase1566309710204.groovy:21)
Caused by: java.lang.IllegalArgumentException: Object is null
	at com.kms.katalon.core.helper.KeywordHelper.checkTestObjectParameter(KeywordHelper.java:33)
	at com.kms.katalon.core.webui.keyword.builtin.ScrollToElementKeyword$_scrollToElement_closure1.doCall(ScrollToElementKeyword.groovy:76)
	at com.kms.katalon.core.webui.keyword.builtin.ScrollToElementKeyword$_scrollToElement_closure1.call(ScrollToElementKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	... 16 more

Hi,
Use

WebUI.scrollToElement(to, 3)
WebUI.click(to)