Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial swipe left is not working #580

Closed
vikramvi opened this issue Feb 22, 2017 · 20 comments
Closed

Partial swipe left is not working #580

vikramvi opened this issue Feb 22, 2017 · 20 comments

Comments

@vikramvi
Copy link

Description

  1. I've an element in form of row ( XCUIElementTypeTable[1]/XCUIElementTypeCell[1] ) on which I need to swipe partial left
  2. This will unhide button on right side of the row ( XCUIElementTypeTable[1]/XCUIElementTypeCell[1]/XCUIElementTypeButton[1] )
  3. I have tried all options possible but couldn't get this working
  4. It always results in normal swipe and next screen gets loaded

Environment

  • java client build version or git revision if you use some shapshot: 5.0.0-BETA3
  • Appium server version or git revision if you use some shapshot: 1.6.4. beta
  • Desktop OS/version used to run Appium if necessary: Mac 10.11.6
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: v7.2.1
  • Mobile platform/version under test: 10.2
  • Real device or emulator/simulator: iOS Simulator

Details

have provided in description

Code To Reproduce Issue [ Good To Have ]

I tried below ways to achieve swipe left in partially

`TouchAction action1 = new TouchAction(driver).press(250 , 147).waitAction(-200).moveTo(147, 200).release();
action1.perform();

            	/*WebElement rowToSlide = AppiumController.instance.driver.findElement(By.xpath("//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]//XCUIElementTypeTable[1]/XCUIElementTypeCell[1]"));
            	               
            	TouchAction swipe = new TouchAction(driver).press(rowToSlide, 250 , 147)
                     .waitAction(-200).moveTo(rowToSlide, 200, 147).release();
      
                     swipe.perform();*/
      
    	    
            	/*Dimension size = rowToSlide.getSize();
            	
            	TouchAction swipe = new TouchAction(driver).press(rowToSlide, size.width / 2 + 100 , size.height / 2).waitAction(2000)
            	            .moveTo(rowToSlide, 100, size.height / 2).release().perform();
            	        //swipe.perform();

*/
// Point location = rowToSlide.getLocation();
//Point center = ((MobileElement) rowToSlide).getCenter();

            	/*WebElement element = AppiumController.instance.driver.findElement(By.xpath("//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]//XCUIElementTypeTable[1]/XCUIElementTypeCell[1]"));
            	Integer x_coordinate = element.getLocation().x;
            	Integer y_coordinate = element.getLocation().y;
            	Integer height = element.getSize().height;
            	Integer width  = element.getSize().width;
            	
            	TouchAction action = new TouchAction(driver);
            	action.press(element).waitAction(1000).moveTo(250, 0).release().perform();`

https://gist.github.com/vikramvi/220ba19708a8f1ec0bbc8d906072f209

Ecxeption stacktraces

Please create a gist with pasted stacktrace of exception thrown by java.

Link to Appium logs

Please create a gist which is a paste of your full Appium logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read!
If you are reporting a bug, always include Appium logs as linked gists! It helps to define the problem correctly and clearly.

@SrinivasanTarget
Copy link
Member

@vikramvi Why is waitAction negative?

@SrinivasanTarget
Copy link
Member

@vikramvi How do you got the values as 250 etc etc hotcoded there?

@vikramvi
Copy link
Author

@SrinivasanTarget I tried by giving positive value, removing it altogether and later negative. This was one of the options suggested on appium forum.

But none of them working in this case

@SrinivasanTarget
Copy link
Member

AFIK @vikramvi waitAction should be always positive.

@vikramvi
Copy link
Author

@vikramvi How do you got the values as 250 etc etc hotcoded there?

First I calculated size of the row which is {0,120} {0,174} { 320,120} {320,174}. To get it work at least, I tried hard coding the values.

@vikramvi
Copy link
Author

AFIK @vikramvi waitAction should be always positive.

I tried but didn't work in that case as well

@vikramvi
Copy link
Author

One more solution mentioned https://discuss.appium.io/t/partial-swipe-left-on-ios-simulator-10-x-not-working/14948/2 , didn't work as well

@SrinivasanTarget
Copy link
Member

I tried but didn't work in that case as well

I believe it should be the issue with the co.ord's given.

@vikramvi
Copy link
Author

@SrinivasanTarget can you please suggest what co-ordinates should I try, I spent 2 days and come to conclusion that this could be a bug.

Please refer to attached 2 screen shots for confirmation about correct co-ordinates.

screen shot 2017-02-22 at 12 13 15 pm
screen shot 2017-02-22 at 12 13 24 pm

@SrinivasanTarget
Copy link
Member

@vikramvi I don't suggest getting Co.ords using Appium/any Inspector. Something that we need to calculate through the dimensions of element. Should be something like this, https://github.com/saikrishna321/VodQaAdvancedAppium/blob/master/src/test/java/com/appium/gesture/GestureTest.java#L25.

@vikramvi
Copy link
Author

vikramvi commented Feb 22, 2017

yes I tried it already, just used appium client to cross check co-ordinates. Earlier posted co-ordinates have got from code and not appium client. @SrinivasanTarget

@saikrishna321
Copy link
Member

@vikramvi can you post this on appium.discuss forum with your sample app. That would help to reproduce.

@triager please close 😉

@vikramvi
Copy link
Author

vikramvi commented Feb 22, 2017

@saikrishna321 @SrinivasanTarget @TikhomirovSergey I still feel this is a valid bug. I played with the app for 30 mins.

The behaviour is similar to Mail app in iOS.

I think chaining of events are not happening properly in this case.
Instead of waiting for next chain event Press -> MoveTo -> Release -> Perform
It's( client / server ) doing Press which is resulting in next screen to open; similar to Mail app.

Let me search for some open source project with similar behaviour to reproduce issue

@RockChild
Copy link

RockChild commented Feb 22, 2017

@vikramvi Are you sure that you need to swipe? I mean what is the purpose for swipe?

@TikhomirovSergey
Copy link
Contributor

@vikramvi It is not the client bug.

@vikramvi
Copy link
Author

@RockChild yes, I need to do swipe to get button enabled on right side of row; similar to Mail app email row.

@TikhomirovSergey shall I close this and open new issue in appium repo ?

@TikhomirovSergey
Copy link
Contributor

Please open a new issue here
https://github.com/appium/appium/issues. This issue is related to this repo: https://github.com/appium/appium-xcuitest-driver.

The new one issue please link to this one. User should know where is the problem :)

@vikramvi
Copy link
Author

@TikhomirovSergey thanks for confirming it's bug on server side. I've opened new issue appium/appium#7914

@mykola-mokhnach
Copy link
Contributor

@TikhomirovSergey I think this one can be closed as java-driver unrelated issue

@vikramvi
Copy link
Author

vikramvi commented Apr 6, 2017

@triager please close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants