{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/6181","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/6181/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/6181/comments","events_url":"https://api.github.com/repos/appium/appium/issues/6181/events","html_url":"https://github.com/appium/appium/issues/6181","id":135934928,"number":6181,"title":"Swipe not working for particular selecting item from List in mobile app","user":{"login":"Sruthi-M","id":12639645,"avatar_url":"https://avatars.githubusercontent.com/u/12639645?v=3","gravatar_id":"","url":"https://api.github.com/users/Sruthi-M","html_url":"https://github.com/Sruthi-M","followers_url":"https://api.github.com/users/Sruthi-M/followers","following_url":"https://api.github.com/users/Sruthi-M/following{/other_user}","gists_url":"https://api.github.com/users/Sruthi-M/gists{/gist_id}","starred_url":"https://api.github.com/users/Sruthi-M/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sruthi-M/subscriptions","organizations_url":"https://api.github.com/users/Sruthi-M/orgs","repos_url":"https://api.github.com/users/Sruthi-M/repos","events_url":"https://api.github.com/users/Sruthi-M/events{/privacy}","received_events_url":"https://api.github.com/users/Sruthi-M/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/appium/appium/labels/NeedsTriage","name":"NeedsTriage","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T02:41:45Z","updated_at":"2016-02-24T06:59:47Z","closed_at":null,"body":"## The problem\r\n\r\nswipe from right to left is not working in mobile app.\r\n## Environment\r\n\r\n* Appium version -1.4.16\r\n* Desktop OS/version -ubuntu 14.04 LTS\r\n* Node.js version v4.2.6\r\n* Mobile platform: Android 5.1\r\n* Real device \r\n\r\n\r\n## Details\r\n\r\nI have list of items.In the list items selecting one item and swipe right to left.But the problem is swipe didn't worked.\r\nHtml code \r\n```\r\n<img ng-class=\"getRightImage(item)\" src=\"img/Power-Button-icon.png\" class=\"offIcon\">\r\n\r\n<h2><strong class=\"ng-binding\">aws8 - aws sdk test</strong> <ion-spinner ng-hide=\"!( item.state == 'stopping' || item.state == 'pending') \" style=\"display:inline\" class=\"spinner spinner-ios ng-hide\"> </ion-spinner>  </h2>\r\n</div>\r\n\r\n<div class=\"item-options invisible\"><ion-option-button class=\"button-royal icon ion-play button\" ng-hide=\"!( item.state == 'stopped') \" ng-click=\"startInstance(item)\"></ion-option-button></div>\r\n```\r\n\r\ntest case\r\n\r\n```\r\nList<WebElement> instances = driver.findElements(By.className(\"item-content\"))\r\n\r\nString instanceName=instances.get(3).getText();\r\n\r\n for (WebElement singleInstance : instances) {\r\n\r\nString instanceh2Text = singleInstance.getText();\r\n\r\nif(instanceh2Text.equals(instanceName)){\r\n\r\nPoint point = singleInstance.getLocation(); \r\n\r\nint xcord = point.getX(); \r\n\r\nint ycord = point.getY(); \r\n\r\nWebElement startButton=driver.findElement(By.className(\"button-royal\"));\r\n\r\nstartButton.click();\r\n\r\n}\r\n\r\n}\r\n```\r\n\r\nI tried these ways\r\n1.Dimension size = driver.manage().window().getSize(); \r\n            \tint startx = (int) (size.width * 0.8); \r\n            \tint endx = (int) (size.width * 0.20); \r\n            \tint starty = size.height / 2; \r\n            \tdriver.swipe(startx, starty, endx, starty, 1000);\r\ngetting org.openqa.selenium.WebDriverException: unknown error: operation is unsupported on Android\r\n2.JavascriptExecutor executor = (JavascriptExecutor)driver;\r\nexecutor.executeScript(\"arguments[0].click();\", startButton);\r\n3. TouchAction action = new TouchAction(driver);\r\naction.press(element).waitAction(300).moveTo(element1).release().perform();\r\nint leftX = el.getLocation().getX();\r\nint rightX = leftX + el.getSize().getWidth();\r\nint upperY = el.getLocation().getY();\r\nint lowerY = upperY - el.getSize().getHeight();\r\nint middleY = (upperY - lowerY) / 2;\r\nif (orientation.equals(\"portrait\"))\r\n{ driver.swipe(leftX + 5, middleY, rightX - 5, middleY, 500); }\r\nelse if (orientation.equals(\"landscape\"))\r\n{ driver.swipe(rightX - 5, middleY, leftX + 5, middleY, 500); }\r\n\r\nbut didn't work\r\n\r\n## Link to Appium logs\r\n\r\nCreate a [gist](https://gist.github.com) 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!"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/188109551","html_url":"https://github.com/appium/appium/issues/6181#issuecomment-188109551","issue_url":"https://api.github.com/repos/appium/appium/issues/6181","id":188109551,"user":{"login":"subhashreddyG","id":17446731,"avatar_url":"https://avatars.githubusercontent.com/u/17446731?v=3","gravatar_id":"","url":"https://api.github.com/users/subhashreddyG","html_url":"https://github.com/subhashreddyG","followers_url":"https://api.github.com/users/subhashreddyG/followers","following_url":"https://api.github.com/users/subhashreddyG/following{/other_user}","gists_url":"https://api.github.com/users/subhashreddyG/gists{/gist_id}","starred_url":"https://api.github.com/users/subhashreddyG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subhashreddyG/subscriptions","organizations_url":"https://api.github.com/users/subhashreddyG/orgs","repos_url":"https://api.github.com/users/subhashreddyG/repos","events_url":"https://api.github.com/users/subhashreddyG/events{/privacy}","received_events_url":"https://api.github.com/users/subhashreddyG/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T06:59:47Z","updated_at":"2016-02-24T06:59:47Z","body":"\r\nint lowerY = upperY - el.getSize().getHeight();\r\nmiddleY = (upperY - lowerY) / 2           will mislead to wrong location.\r\n \r\nchange it to:\r\nint upperY = el.getLocation().getY();\r\nint lowerY = upperY + el.getSize().getHeight();\r\nint middleY = (upperY + lowerY) / 2;\r\n\r\nit will work..\r\n\r\n"}}