Running test with scrolltoelement


I have noticed that when i use scrollToElememt i am not able to click/check on the element i just scrolled to on chrome.
I get the below error:
Unable to check object ‘Object Repository/Generic Test Object/2.0 CreUnClient/CliquerSurModuleMaTresorerie’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to check object ‘Object Repository/Generic Test Object/2.0 CreUnClient/CliquerSurModuleMaTresorerie’
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.CheckKeyword.check(CheckKeyword.groovy:88)
at com.kms.katalon.core.webui.keyword.builtin.CheckKeyword.execute(CheckKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.check(WebUiBuiltInKeywords.groovy:1065)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$check$ Source)
at 1.0 Ajouter_Un_Client:172)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
at com.kms.katalon.core.main.TestCaseExecutor.runScript(
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
at com.kms.katalon.core.main.TestCaseExecutor.execute(
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(
at com.kms.katalon.core.main.TestSuiteExecutor.execute(
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$ Source)
Caused by: org.openqa.selenium.ElementClickInterceptedException: element click intercepted:

I have made the same changes in headless mode and it is working fine there.
Can someone please advise what i can do to make scrolling to an element work both in headless and normal chrome.

Thank you

That means the target is not clickable because it’s obscured by something else.

I don’t know of any discrepancies between full browser and headless but I don’t have much experience in the latter, either.

As for scrolling, I use a JavaScript function:

function scrollIntoView(selector) {

I use it rarely because I rarely need it - but it has never failed me.

Thanks @Russ_Thomas,

Is it possible to use this method with nested elements.
I have this in my code. I need to click on "Mon activité’

	> 			<i class="fa fa-briefcase"></i>
				<span class="title">Mon activité</span>
					<span class="arrow open"></span>

There are other places where the class “title” and “fa fa-briefcase” has been used in the same page.
I tried to use contains but it is not working

@anuradha Instead of scrolling TO the element you want, scroll to the element ABOVE the one you want. (either one element or two elements above). That way, you have the element you want in the viewport. (Maybe the actual browser is blocking your clicks.)

As for getting your nested elements, have you tried getting the text, Mon activité.
// span[text()=‘Mon activité’]