モバイル ネイティブ アプリでのスクロールに問題があります。使用しています: 言語としての Java Java クライアント 1.7.0 appium ノード 1.13.0 OS バージョン Android AND Appium ドライバー
「プロフィール」ページに入ってからスクロールしようとしましたが、アプリがクラッシュする方法がいくつかあります。
スクロールには次の Methode を使用しています。
public void scrollDown() {
Dimension dimension = driver.manage().window().getSize();
// System.out.println("Dimension value = "+dimension);
Double scrollHeightStart = dimension.getHeight() * 0.5;
int scrollStart = scrollHeightStart.intValue();
// System.out.println("Screen Height start Value="+scrollHeightStart);
Double scrollHeightEnd = dimension.getHeight() * 0.2;
int scrollEnd = scrollHeightEnd.intValue();
// System.out.println("Scroll Start Value="+scrollHeightEnd);
TouchAction touch = new TouchAction((PerformsTouchActions) driver);
touch.press(PointOption.point(0, scrollStart))
.waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1)))
.moveTo(PointOption.point(0, scrollEnd))
.release()
.perform();
}
ただし、 Scroll メソッドを呼び出してスクリプトを実行した後、 Log で次のようになります。
..........
.......
Juni 22, 2019 3:31:18 VORM. utilities.Helper startAppiumServer
INFO: utilities.Helper§§§§§§§§§§§§§§§§§§§§§§§ Start Appium Server §§§§§§§§§§§§§§§§§§§§§§§§§
startAppiumServer: Before Test done
[HTTP] Could not start REST http interface listener. The requested port may already be in use. Please make sure there is no other instance of this server running already.
Fatal Error: listen EADDRINUSE: address already in use 127.0.0.1:4723
at Server.setupListenHandle [as _listen2] (net.js:1270:14)
at listenInCluster (net.js:1318:12)
at doListen (net.js:1451:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
Juni 22, 2019 3:31:31 VORM. io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
INFO: Detected dialect: W3C
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/khazinehdarllo/.m2/repository/cglib/cglib/3.2.8/cglib-3.2.8.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Juni 22, 2019 3:31:31 VORM. utilities.Helper getmMthodName
INFO: utilities.Helper +++++++++++++++++++++ Start of Test Execution: Test Case TC_1296_ForgotPassword_FromChangePasswordScreen +++++++++++++++++++++++++++
Juni 22, 2019 3:31:37 VORM. screens.Welcome_Screen click_Login_Button
INFO: screens.Welcome_ScreenWELCOME Screen: Login Button clicked successfully (OK)
Juni 22, 2019 3:31:47 VORM. screens.Login_Screen enter_Valid_Email
INFO: screens.Login_ScreenREGISTRATION Screen: Email Field entered successfully (OK)
Juni 22, 2019 3:31:53 VORM. screens.Login_Screen enter_Valid_Password
INFO: screens.Login_ScreenREGISTRATION Screen: Password Field entered successfully (OK)
Juni 22, 2019 3:31:54 VORM. screens.Login_Screen select_remainLoggedIn_CheckBox
INFO: screens.Login_ScreenLOGIN Screen : RemainLoggedIn Checkbox selected successfully (OK)
Juni 22, 2019 3:31:55 VORM. screens.Login_Screen click_Login_Button
INFO: screens.Login_ScreenLOGIN Screen : Login Button clicked successfully (OK)
Juni 22, 2019 3:31:58 VORM. screens.SelectCity_Screen select_X
INFO: screens.SelectCity_ScreenSELECT CITY Screen : City X clicked successfully (OK)
Juni 22, 2019 3:32:01 VORM. screens.CommonObjects_InAll_Screen click_Profile_Icon
INFO: screens.CommonObjects_InAll_ScreenCOMMON OBJECT Profile Icon : Profile Icon clicked successfully (OK)
java.lang.NullPointerException
at utilities.PageActions.scrollDown(PageActions.java:308)
at testScripts.login.errorHandling.Login_ErrorHandling_No_FTU_Tests.TC_1296_ForgotPassword_FromChangePasswordScreen(Login_ErrorHandling_No_FTU_Tests.java:119)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Juni 22, 2019 3:32:01 VORM. testScripts.BasicSetup stopApp
INFO: testScripts.BasicSetupDestroying Test Environment
Juni 22, 2019 3:32:01 VORM. testScripts.BasicSetup stopApp
INFO: testScripts.BasicSetupStop App
Juni 22, 2019 3:32:01 VORM. testScripts.BasicSetup stopApp
INFO: testScripts.BasicSetup ===================== End of Test Execution ===========================
===============================================
Default Suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================
Juni 22, 2019 3:32:02 VORM. testScripts.login.errorHandling.Login_ErrorHandling_No_FTU_Tests stopAppiumServer
INFO: testScripts.login.errorHandling.Login_ErrorHandling_No_FTU_TestsStop Appium Server
Juni 22, 2019 3:32:02 VORM. testScripts.login.errorHandling.Login_ErrorHandling_No_FTU_Tests stopAppiumServer
INFO: testScripts.login.errorHandling.Login_ErrorHandling_No_FTU_Tests===============================================
および .PageActions.scrollDown(PageActions.java:308) はメソッド scrollDown のコードにあります。
次元次元 = driver.manage().window().getSize();
私の想定では、スクロール ビューはページの先頭から開始されないため、最初にスクロール ビュー レイアウトに切り替えてからスクロールする必要があります。
登録またはログイン画面で同じビューを持っていますが、最初にスクロールビュー内の他のポイントをクリックすると、たとえば電子メールまたは名前を入力すると、スクロールダウンできますが、このウィンドウ (プロファイル) ではできません