Swipe or scroll on genymotion

Hello to all
I have appium version 1.3.6 and I can’t scroll to Element or swipe. I have element on my screen, but it is not visible on screen. I want to scroll to it - scrollTo(“element”), but have an error:

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 7
at com.google.gson.JsonParser.parse(JsonParser.java:65)
at com.google.gson.JsonParser.parse(JsonParser.java:45)
at io.appium.java_client.ComplexFind.execute(ComplexFind.java:81)
at io.appium.java_client.ComplexFind.scrollToExact(ComplexFind.java:62)
at io.appium.java_client.AppiumDriver.scrollToExact(AppiumDriver.java:528)
at com.softek.qa.andropium.iws.core.ScreenParamsTest.footerTextOnLoginTest(ScreenParamsTest.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:200)
at com.softek.qa.andropium.system.AndropiumListener.run(AndropiumListener.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:212)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:707)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 7
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505)
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1386)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:531)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:414)
at com.google.gson.JsonParser.parse(JsonParser.java:60)
… 42 more

scrollTo() expects a string as an input argument, that is the text name of the element you are looking and this function returns WebElement.

Ex: In your application, if you have option say “Appium” some where at the bottom after scrolling and you want to scroll till “Appium”,

you should use:

driver.scrollTo("Appium")

Once you scroll, if you want to click on Appium, you can use statement like:

driver.scrollTo("Appium").click
WebElement ele=driver."your meachanism to identify this webelement"
ele.click();

I hope the above helps.

Thanks,
Uday

But appium can’t find this element - http://monosnap.com/image/sHDOghcF1zC2tDi9GDRGABp9SiubKL - in inspector i can find it by id http://monosnap.com/image/VyUmhq7RuZjm9RPlDsd6UWgZr36GSQ, but text will be displayed after scroll to this button

Did you tried driver.scrollTo(“Help”) and then fine your button.

Pseudo code:

driver.scrollTo(“Help”)
WebElement ele=driver.“your identification strategy to identify next element” //I am hoping even this element have some name right?

First manually find the name of your button. Say “xyz”
Then directly give driver.scrollTo(“xyz”)