@@ -16,8 +16,6 @@ public static class HelperExtensions
1616 /// <summary>
1717 /// For desktop, this will perform a mouse click on the target element.
1818 /// For mobile, this will tap the element.
19- /// This API works for all platforms whereas TapCoordinates currently doesn't work on Catalyst
20- /// https://github.com/dotnet/maui/issues/19754
2119 /// </summary>
2220 /// <param name="app">Represents the main gateway to interact with an app.</param>
2321 /// <param name="element">Target Element.</param>
@@ -29,8 +27,6 @@ public static void Tap(this IApp app, string element)
2927 /// <summary>
3028 /// For desktop, this will perform a mouse click on the target element.
3129 /// For mobile, this will tap the element.
32- /// This API works for all platforms whereas TapCoordinates currently doesn't work on Catalyst
33- /// https://github.com/dotnet/maui/issues/19754
3430 /// </summary>
3531 /// <param name="app">Represents the main gateway to interact with an app.</param>
3632 /// <param name="query">Represents the query that identify an element by parameters such as type, text it contains or identifier.</param>
@@ -308,8 +304,6 @@ public static void Click(this IUIElement element)
308304 /// <summary>
309305 /// For desktop, this will perform a mouse click on the target element.
310306 /// For mobile, this will tap the element.
311- /// This API works for all platforms whereas TapCoordinates currently doesn't work on Catalyst
312- /// https://github.com/dotnet/maui/issues/19754
313307 /// </summary>
314308 /// <param name="element">Target Element.</param>
315309 public static void Tap ( this IUIElement element )
@@ -409,11 +403,18 @@ internal static void DoubleTap(this IApp app, IUIElement? element)
409403 /// <param name="y">The y coordinate to double tap.</param>
410404 public static void DoubleTapCoordinates ( this IApp app , float x , float y )
411405 {
412- app . CommandExecutor . Execute ( "doubleTapCoordinates" , new Dictionary < string , object >
406+ if ( app is AppiumCatalystApp )
413407 {
414- { "x" , x } ,
415- { "y" , y }
416- } ) ;
408+ app . DoubleClickCoordinates ( x , y ) ; // Directly invoke coordinate-based double click for AppiumCatalystApp.
409+ }
410+ else
411+ {
412+ app . CommandExecutor . Execute ( "doubleTapCoordinates" , new Dictionary < string , object >
413+ {
414+ { "x" , x } ,
415+ { "y" , y }
416+ } ) ;
417+ }
417418 }
418419
419420 /// <summary>
@@ -1422,11 +1423,18 @@ public static void ClickCoordinates(this IApp app, float x, float y)
14221423 /// <param name="y">The y coordinate to tap.</param>
14231424 public static void TapCoordinates ( this IApp app , float x , float y )
14241425 {
1425- app . CommandExecutor . Execute ( "tapCoordinates" , new Dictionary < string , object >
1426+ if ( app is AppiumCatalystApp )
14261427 {
1427- { "x" , x } ,
1428- { "y" , y }
1429- } ) ;
1428+ app . ClickCoordinates ( x , y ) ; // // Directly invoke coordinate-based click for AppiumCatalystApp.
1429+ }
1430+ else
1431+ {
1432+ app . CommandExecutor . Execute ( "tapCoordinates" , new Dictionary < string , object >
1433+ {
1434+ { "x" , x } ,
1435+ { "y" , y }
1436+ } ) ;
1437+ }
14301438 }
14311439
14321440 /// <summary>
0 commit comments