0

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)

2 Answers2

0

This doesn't necessarily mean you are unable to scroll to an element. You are missing a parameter.

The error message is saying you are trying to pass the wrong types of argument to scrollToElement() function. It is expecting a TestObject and an int (timeout in seconds) and you are passing in only the test object.

It should be something like

WebUI.scrollToElement(findTestObject('your test object'), 3)
Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
  • Having the similar issue even though I have test object defined in it.; WebUI_scrollToElement(findTestObject('xxx/yyy/zzzz')). May be something else? I don't think so it has to do adding the Test object, – Tes Apr 29 '20 at 23:31
  • See the updated answer. Maybe you are missing the timeout value. – Mate Mrše Apr 30 '20 at 06:37
  • My code was like this: WebUI_scrollToElement(findTestObject('xxx/yyy/zzzz'), 2) . It didn't work. Steps to reproduce: I recorded the objects and its attributes using "Spy Web", it went good. Then, to verify, I hit "Verify and Highlight" button located at the bottom left corner. I got this error message "unable to find object by xpath selector". It's there but couldn't find its recorded object. The paradox; was it fake the record xpath at first place???? – Tes Apr 30 '20 at 12:52
  • xpath obtained by spy-record can be flaky. Check if that is the right element by: 1. With your page opened in Chrome, press F12, DevTools will open 2. In DevTools, select Console tab 3. enter $('your xpath') in the console prompt (next to > ). If the xpath is valid, you should see the element highlighted on the page. – Mate Mrše Apr 30 '20 at 13:29
  • Hi Mate; Thanks for your time and suggestion. When you hover over the attributes, yes it highlights the target button & I see the correct xpath/CSS selector. But for unknown reason, Katalon didn’t like it while u replaying its recorded objects. I guess it could be a kinda of bug.... my argument is: If the correct xpath couldn’t be found while replaying, where Katalon got that xpath at first place while recording. there was no issue while recording. It completed all the steps capturing objects. But when u replaying, the “xpath not found “. May be needed a magic here! – Tes May 01 '20 at 20:52
  • Auto generated xpath might be dynamic and thus valid only for that browser run that created it. I suggest learning how to write xpath yourself. – Mate Mrše May 02 '20 at 07:27
  • Thanks again, Mate. My question was to find out if the capturing error has to do with Katalon. Now am not expecting any further suggestions. Regarding...., know how to inspect elements and have no issues with other web elements I am working on except the one I shared here with u all. May be I needed to talk to the Dev team. – Tes May 03 '20 at 21:19
0

If you are unable to find Test Object, and it is at the bottom of the page, try scrolling to position high absisse and ordinate. for example WebUI.scrollToPosition(9999999, 9999999) Then try click on the Objct

Yvan Rugwe
  • 618
  • 7
  • 13