I am currently unable to swipe on an iOS simulator (iPhone 8, 11.3). I initially used Appium desktop v1.8.0 (JS) to record which provided me with TouchAction code:
.touchAction([
{action: ‘press’, x: 306, y: 332},
{action: ‘moveTo’, x: -233, y: 3},
‘release’
])
This didn’t appear to do anything. When I looked at the actual coordinates, it seemed very wrong that it was moving to minus, so I updated it manually:
.touchAction([
{action: ‘press’, x: 320, y: 350},
{action: ‘moveTo’, x: 80, y: 350},
‘release’
])
This also is doing nothing.
I have tried implementing waitforexists and a pause prior to execution of this.
I have tried using swipe and swipeLeft commands which don’t seem to work and also say they are being deprecated (even tried referencing an element beforehand and even XPath which I know is not recommended):
i.e:
.element("~img_icon_bag")
&
.swipe(’//XCUIElementTypeApplication[@name=“xxx”]/XCUIElementTypeWindow[1]’, -200, 0, 2)
.swipeLeft(’//XCUIElementTypeApplication[@name=“xxx”]/XCUIElementTypeWindow[1]’, 2)
Below is my headers:
const wdio = require(‘webdriverio’);
const caps = {“platformName”:“iOS”,“platformVersion”:“11.3”,“deviceName”:“iPhone 8”,“app”:"/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-hlggtgxwuwcrdofzomwyfksiintx/Build/Products/Developer-iphonesimulator/xxx.app",“automationName”:“XCUITest”};
const driver = wdio.remote({
protocol: “http”,
host: “localhost”,
port: 4723,
path: “/wd/hub”,
desiredCapabilities: caps
});
Running the file via terminal:
node test.js
I am not sure what else to try…I read somewhere that it is unable to swipe in a Simulator, but surely that can’t be right?
Appreciate any help!