Using proportions with c#

How can you use a proportional system so that the scroll feature would not be based on a specific x and y coordinate on the phone screen. I need my program to be able to function across devices regardless of screen size. I am using C#.

Thank you

Look through the ‘scroll’ actions in TouchActions:

Scrolling ‘down’ for example should work regardless of screen size:

// c#
Dictionary<string, string> scrollObject = new Dictionary<string, string>();
scrollObject.Add("direction", "down");
((IJavaScriptExecutor)driver).ExecuteScript("mobile: scroll", scrollObject));

It says string is not a function

I have no idea what you are talking about.

The C# code is not working for me

Im getting the following error at the IJavaScriptExecutor:

An unhandled exception of type ‘System.NotImplementedException’ occurred in WebDriver.dll