How to tab dynamically on screen

Hi

We use the below function to tab on screen on fixed with and height:

TouchAction action = new TouchAction(getDriver());
waitForThePageToLoad(1);
action.press(point((int) width, (int) > > >height)).waitAction(waitOptions(ofSeconds(1))).release().perform();

its working correctly, but it will fail if we changed the mobile because the screen size is different.
How can we use the tab or the press function in a way that it tab and work on all sizes?

Usually you tap on an element, and you should specify directly to tap on it.
Or try to get some reference coordinates from some elements, and then calculate where you want to tap.
What is the exact use case?

Hi @Zuzeac
For example if i want to click on screen with coordinate (100,200)
when i run this test case on another device with different screen size this case will fail because the coordinate will be different.

So i’m looking if there is a way to handle this dynamically.
instead of adding the coordinate we add a percentage to be handled on all screen size