Running test with scrolltoelement

Hello,

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$12.call(Unknown Source)
at 1.0 Ajouter_Un_Client.run(1.0 Ajouter_Un_Client:172)
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.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:169)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:142)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:91)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1593458646724.run(TempTestSuite1593458646724.groovy:37)
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) {
  document.querySelector(selector).scrollIntoView(true);
}

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>
  </a> 

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
Thanks

@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é’]