Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCUITest coordinate(withNormalizedOffset:) explanation

I need the detailed information about coordinate(withNormalizedOffset:) method.

The information provided in the Apple's docs are very minimal.

This method is all about picking a specific point in the window. But how can I define dx & dy points for a specific point?

Consider the four corners of the window. Top Left, Top Right, Bottom Left, Bottom Right. Can someone provide details on this?

  • What is mean by normalizedOffset?
  • What is dx & dy and their range?
like image 494
Confused Avatar asked Aug 29 '26 17:08

Confused


1 Answers

Range of dx & dy is 0 to 1 allowing float values. Normalized Offset is the x and y coordinates w.r.to the width and height of the object respectively.

Say we have an object of width 245 and height 432, and we need coordinate (10, 34) on it. The normalized offset is (10 / 245, 34 / 432) i.e. (0.040816327, 0.078703704) where the actual offset is (10, 34).

like image 173
Prakash Saravanan Avatar answered Sep 01 '26 01:09

Prakash Saravanan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!