Comment appuyer sur le robinet et maintenez enfoncé et faites défiler vers le bas à l'aide de webdriverio et d'appui. J'ai utilisé un défilement normal mais rien ne semble fonctionner. Je peux manuellement tenir et glisser manuellement, mais les commandes ci-dessous ne fonctionnent pas
C'est ce que j'ai essayé, cependant, je ne suis pas en mesure d'y réaliser avec elle: P>
browser.touchAction([ { action: 'longPress'}, { action: 'moveTo', x: -10, y: 0}, { action: 'release'} ]) }
3 Réponses :
J'ai utilisé ce qui suit pour faire défiler vers le bas pour mon appui Python Python
for each in range(1, 2): driver.swipe(500, 1700, 500, 1000, 400)
Je ne pense pas avoir quelque chose de similaire dans webdriverio
public static void fingerSwipe(int startX, int startY, int endX, int endY, long timeInMillis){ PointerInput touchAction = new PointerInput(PointerInput.Kind.TOUCH, "touchAction"); Interaction moveToStart = touchAction.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), startX, startY); Interaction pressDown = touchAction.createPointerDown(PointerInput.MouseButton.LEFT.asArg()); Interaction moveToEnd = touchAction.createPointerMove(Duration.ofMillis(timeInMillis), PointerInput.Origin.viewport(), endX, endY); Interaction pressUp = touchAction.createPointerUp(PointerInput.MouseButton.LEFT.asArg()); Sequence swipe = new Sequence(touchAction, 0); swipe.addAction(moveToStart); swipe.addAction(pressDown); swipe.addAction(moveToEnd); swipe.addAction(pressUp); driver.perform(Arrays.asList(swipe)); } I use selenium interactions package to perform a swipe using JAVA and appium. Try using something similar to above code in WebDriverIo for Appium versions - 1.15.0 and above. You just need to pass input parameters depending upon the swipe you want to perform. 'long timeInMillis' is the time period of the swipe.
désolé mais je demande un webdriverio et cela ne fonctionne pas pour moi
J'ai utilisé ceci:
await browser.touchPerform([ { action: 'press', options: { x: 500, y: 1280 }}, { action: 'wait', options: { ms: 1000}}, { action: 'moveTo', options: { x: 500, y: 347}}, { action: 'release' } ]);