ScrollTo() issue

Hi All,
I’m trying to use the ScrollTo() function in C# in order to Clear the the Notification Bar when it’s opening.
First of all, The test is not failing.
Seems like the Scroll is happening or there’s a click smewhere but I’m not really see it happens and it is definetely neither clicking the Clear button nor Clearing the notification bar.
The thing s that when I’m opening the Notification Bar at First, I don’t see the Clear button:

So, I want to scroll to the Clear Button First, and the Click on it.
I have tried both Clicking and Scroll().Click but nothing really happens.
` _driver.Context = “NATIVE_APP”;
_driver.OpenNotifications();
try
{
_driver.ScrollTo(“Clear”);
}

       Catch{}`

Inorder to know where the scroll is happening, you can actually use developer settings from the device to debug more on it.
Go to Developer options–>Input --> and enable both show touches and pointer location,
This will show the pointer on the screen where the action is taking place. This will help you in debugging the issue.

If scroll to is not working , try using the below code instead of scrollTo.
str= element name text;
driver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(”"+str+"").instance(0))")).click();

@Pradeep_p Thank you for the response.

Unrtunately, the scrollTo isn’t working. it should be easy isn’t it?

In addition, I think that the second suggestion is not a C# syntax , am I right?

Anyway, I manage to do a Swipe. I set the duration to 500(milliseconds)