robotframework-appiumlibrary icon indicating copy to clipboard operation
robotframework-appiumlibrary copied to clipboard

Touch Keywords on iOS real device playing Safari

Open mzbedat opened this issue 9 years ago • 5 comments

Hi,

I have iOS9.3 device running on Mac OS X 10.11.6 (El Capitan) with Appium 1.5.3 Python 2.7, and robotframework-appiumlibrary upgraded to most updated one.

My flow is to open Safari (with SafariLauncher) on device and go to video content sites (like DailyMotion) to play a video. The problem is that the video is not auto played on iOS devices and there is a need to click on the play button to start playing it.

I tried using the "Click A Point" keyword but no matter what coordinates am giving it its always giving me: Cant Click on A point at (x,y) I tried using the other keyword "Click Element At Coordinates" but I got: This method is not implemented yet.

Anyway, what I tried to do is to switch the context from native to web view before the click but it also didn't help.

Can I use the touch keywords working with Safari? What am missing? Please advice...

Thanks.

mzbedat avatar Dec 20 '16 10:12 mzbedat

@I tried one more thing... took the SafariLauncher.app from Xcode project (located in: /Users/admin/Library/Developer/Xcode/DerivedData/SafariLauncher-bkdnaturwnmsengjlmwxalvxxogo/Build/Products/Debug-iphoneos/SafariLauncher.app) and put it in "App Path" from Appium server (Instead of using "Use Mobile Safari"): snip20161220_12 Then launched the inspector from Appium and got the locator of that play button and used it from code:

${play_locator}= Set Variable xpath=//UIAApplication[1]/UIAWindow[2]/UIAScrollView[1]/UIAScrollView[1]/UIAWebView[1]/UIAButton[2] Wait Until Page Contains Element ${play_locator} 10 Tap ${play_locator}

But still no luck!

mzbedat avatar Dec 20 '16 14:12 mzbedat

@mzbedat my first advice for "Click a Point" and iOS coordinates is that make sure you set the pixel range right. It is generally half the size that you can click.

For example: iPhone 6 is 750 x 1334 on paper, however it is actually 375 x 667 on clickable range. as a reference: https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

Lets see if this will solve your problem, BR

serhatbolsu avatar Dec 20 '16 20:12 serhatbolsu

Hi, thanks for your reply. I used x=100,y=100 in my case, still in range and it doesn't work.

Don't you think it's related to SafariLauncher itself (not clickable)?

mzbedat avatar Dec 21 '16 07:12 mzbedat

@mzbedat Can you look at this appium issue, this might be the case with you? https://github.com/appium/appium/issues/6428

UlhasDeshmukh avatar Dec 21 '16 10:12 UlhasDeshmukh

Yes, it seems similar issue... no resolution yet :s

mzbedat avatar Dec 21 '16 10:12 mzbedat

Closing due to inactivity

serhatbolsu avatar Oct 27 '22 08:10 serhatbolsu