Comments (9)
I just found out that swipes can be performed using this method: TouchActions.Flick(IWebElement, int, int, int)
from dotnet-client.
@ytonthat Have you figured out to use TouchActions? Or do you think i should still expose the Flick through the AppiumDriver class? I honestly don't care, we were just doing the best we could with the Selenium driver we were given.
from dotnet-client.
The TouchActions class allows us to do flick starting from an IWebElement
The Appium drivers in the other languages expose a swipe method that takes a start and end x and y location.
https://github.com/appium/appium/blob/master/docs/en/appium-bindings.md
I think you should expose a similar method to be consistent with the other languages
from dotnet-client.
I actually agree with you - I think we should be consistent with all the other languages.
As for the TouchActions Flick method, you can totally give it an speedX and speedY and run it. (It's one of the overloaded methods).
I will get around to it when I have time, or you're more than welcome to do it and I'll merge it into the codebase.
Cheers,
ASTRO
from dotnet-client.
Thank for the suggestion!
I believe the overloaded method should be used when you don't care about the start x and y coordinates. I actually have a use case in which I need to specify a stating location. To open a navigation drawer in Android, you must start swiping from the far left of your screen. There is no view that represents the edges of the screen in the app I am testing :(
from dotnet-client.
I just tried the new client (1.0.0) with appium server 1.1.0. The new gestures api is awesome. I use this extension method to perform swipes on x/y coordinates and it works fine:
public static void Swipe(this AppiumDriver driver, Location start, Location end)
{
if (driver == null)
{
throw new ArgumentNullException("driver");
}
if (start == null)
{
throw new ArgumentNullException("start");
}
if (end == null)
{
throw new ArgumentNullException("end");
}
ITouchAction action = new TouchAction(driver).Press(start.X, start.Y)
.Wait(ms: 800)
.MoveTo(end.X, end.Y)
.Release();
action.Perform();
}
from dotnet-client.
@ytonthat To open the navigation drawer, what coordinates did you pass to the Swipe
method? Press(0, 100)
doesn't work for me, and Press(-1, 100)
results in an error message "An unknown server-side error occurred while processing the command."
from dotnet-client.
I use x = 1 as a starting point for opening drawers
from dotnet-client.
@ytonthat thanks for the information. Interestingly, I found x-coordinate of the starting point could be any small numbers other than zero.
from dotnet-client.
Related Issues (20)
- Not possible to do move to an element (Windows App) HOT 6
- OpenQA.Selenium.WebDriverException : The executeScript command returned an unexpected error. HOT 10
- I am confused about how should I use WinAppDriver on .NET in the future HOT 5
- Cant seem to tap using new code HOT 14
- [Bug]: Creating WindowsDriver with AppiumOptions throws exeption HOT 9
- [Bug]: AppiumOptions.ToDictionary() returns an empty dictionary HOT 1
- [Feat]: 5.0 release HOT 9
- [Chore]: Add XML comments for visible types or members HOT 7
- [Bug]: None of the Driver Selectors work on a macOS Desktop App HOT 4
- appium.webdriver is missing NuGet package README file HOT 2
- chore: Remove ByIosUIAutomation selector
- [Appium.WebDriver.5.0.0-rc.5]: Toggle wifi functionality not working/ "setConnectivity" "getConnectivity" not supported in .net client even though you could execute via appium inspector HOT 3
- Unable to start Appium server programatically using C# in MAC HOT 8
- Rotate throw System.NotImplementedException HOT 7
- appium crashes when testing a Windows application on virtual machine HOT 7
- [Feat]: RelativeBy functionality from Selenium 4 HOT 5
- Currently only pen and touch pointer input source types are supported HOT 9
- PageFactory and ExpectedConditions are Obsolete. HOT 6
- [Bug]: Shake device option is not available HOT 9
- [Chore]: Update Wiki page -How-to-start-an-AppiumDriver-locally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet-client.