{"action":"closed","issue":{"url":"https://api.github.com/repos/appium/appium/issues/9699","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/9699/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/9699/comments","events_url":"https://api.github.com/repos/appium/appium/issues/9699/events","html_url":"https://github.com/appium/appium/issues/9699","id":276736525,"number":9699,"title":"Unable to Perform Any Click Action With Page Object Model","user":{"login":"TarunDabas86","id":33977484,"avatar_url":"https://avatars1.githubusercontent.com/u/33977484?v=4","gravatar_id":"","url":"https://api.github.com/users/TarunDabas86","html_url":"https://github.com/TarunDabas86","followers_url":"https://api.github.com/users/TarunDabas86/followers","following_url":"https://api.github.com/users/TarunDabas86/following{/other_user}","gists_url":"https://api.github.com/users/TarunDabas86/gists{/gist_id}","starred_url":"https://api.github.com/users/TarunDabas86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TarunDabas86/subscriptions","organizations_url":"https://api.github.com/users/TarunDabas86/orgs","repos_url":"https://api.github.com/users/TarunDabas86/repos","events_url":"https://api.github.com/users/TarunDabas86/events{/privacy}","received_events_url":"https://api.github.com/users/TarunDabas86/received_events","type":"User","site_admin":false},"labels":[{"id":34328464,"url":"https://api.github.com/repos/appium/appium/labels/Android","name":"Android","color":"ADFF2F","default":false},{"id":223534254,"url":"https://api.github.com/repos/appium/appium/labels/NotABug","name":"NotABug","color":"eb6420","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-25T08:52:25Z","updated_at":"2018-05-10T11:04:19Z","closed_at":"2018-05-10T11:04:19Z","author_association":"NONE","body":"## The problem\r\nI am using all latest jar file \r\nSelenium 3.7.1\r\njava-client 5.0.4\r\nappium 1.7.1\r\n\r\nUnable to perfrom any click action using Page Object Model\r\n\r\nif i am using old jar files then everything is working fine.\r\n\r\n\r\nActual Problem :-  I have created Page Object Model  and i am trying to perform click or any function using POM .  but application is crashing after sucessfully launch .\r\nIf i am not using POM and assinging everying in same class file then automation script is working fine.\r\n\r\n\r\n\r\n\r\n## Details\r\n\r\nIf necessary, describe the problem you have been experiencing in more detail.\r\n\r\n## Link to Appium logs\r\n\r\n\r\nThe server is running\r\n\r\n[ADB] Running 'C:\\Users\\MY PC\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' with args: [\"-P\",5037,\"-s\",\"75c26c4c\",\"shell\",\"am\",\"start\",\"-W\",\"-n\",\"com.appotek.patient/com.appotek.patient.SplashActivity\",\"-S\"]\r\n[Appium] New AndroidDriver session created successfully, session e882bb91-88c9-40eb-a416-22e06705677c added to master session list\r\n[BaseDriver] Event 'newSessionStarted' logged at 1511594896102 (12:58:16 GMT+0530 (India Standard Time))\r\n[MJSONWP] Responding to client with driver.createSession() result: {\"platform\":\"LINUX\",\"webStorageEnabled\":false,\"takesScreenshot\":true,\"javascriptEnabled\":true,\"databaseEnabled\":false,\"networkConnectionEnabled\":true,\"locationContextEnabled\":false,\"warnings\":{},\"desired\":{\"UDiD\":\"75c26c4c\",\"app\":\"C:\\\\Users\\\\MY PC\\\\eclipse-workspace\\\\PatientAutomationScript\\\\libs\\\\patient_latest_build_23rdnov2017.apk\",\"appActivity\":\"com.appotek.patient.SplashActivity\",\"appPackage\":\"com.appotek.patient\",\"appium-version\":\"1.7.1\",\"deviceName\":\"75c26c4c\",\"platformName\":\"Android\",\"platformVersion\":\"6.0.1\"},\"UDiD\":\"75c26c4c\",\"app\":\"C:\\\\Users\\\\MY PC\\\\eclipse-workspace\\\\PatientAutomationScript\\\\libs\\\\patient_latest_build_23rdnov2017.apk\",\"appActivity\":\"com.appotek.patient.SplashActivity\",\"appPackage\":\"com.appotek.patient\",\"appium-version\":\"1.7.1\",\"deviceName\":\"75c26c4c\",\"platformName\":\"Android\",\"platformVersion\":\"6.0.1\",\"deviceUDID\":\"75c26c4c\",\"deviceScreenSize\":\"1080x1920\",\"deviceModel\":\"CPH1613\",\"deviceManufacturer\":\"OPPO\"}\r\n[HTTP] <-- POST /wd/hub/session 200 63228 ms - 1020 \r\n[HTTP] --> POST /wd/hub/session/e882bb91-88c9-40eb-a416-22e06705677c/timeouts {\"type\":\"implicit\",\"ms\":60000}\r\n[MJSONWP] Calling AppiumDriver.timeouts() with args: [\"implicit\",60000,\"e882bb91-88c9-40eb-a416-22e06705677c\"]\r\n[BaseDriver] Set implicit wait to 60000ms\r\n[MJSONWP] Responding to client with driver.timeouts() result: null\r\n[HTTP] <-- POST /wd/hub/session/e882bb91-88c9-40eb-a416-22e06705677c/timeouts 200 21 ms - 76 \r\n[HTTP] --> DELETE /wd/hub/session/e882bb91-88c9-40eb-a416-22e06705677c {}\r\n[MJSONWP] Calling AppiumDriver.deleteSession() with args: [\"e882bb91-88c9-40eb-a416-22e06705677c\"]\r\n[BaseDriver] Event 'quitSessionRequested' logged at 1511594908477 (12:58:28 GMT+0530 (India Standard Time))\r\n[Appium] Removing session e882bb91-88c9-40eb-a416-22e06705677c from our master session list\r\n[AndroidDriver] Shutting down Android driver\r\n[ADB] Getting connected devices...\r\n[ADB] 1 device(s) connected\r\n[ADB] Running 'C:\\Users\\MY PC\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' with args: [\"-P\",5037,\"-s\",\"75c26c4c\",\"shell\",\"am\",\"force-stop\",\"com.appotek.patient\"]\r\n[ADB] Pressing the HOME button\r\n[ADB] Getting connected devices...\r\n[ADB] 1 device(s) connected\r\n[ADB] Running 'C:\\Users\\MY PC\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' with args: [\"-P\",5037,\"-s\",\"75c26c4c\",\"shell\",\"input\",\"keyevent\",3]\r\n[AndroidBootstrap] Sending command to android: {\"cmd\":\"shutdown\"}\r\n[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {\"cmd\":\"shutdown\"}\r\n[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN\r\n[AndroidBootstrap] Received command result from bootstrap\r\n[UiAutomator] Shutting down UiAutomator\r\n[UiAutomator] Moving to state 'stopping'\r\n[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {\"status\":0,\"value\":\"OK, shutting down\"}\r\n[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] Time: 21.637\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)\r\n\r\n[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1\r\n\r\n[UiAutomator] UiAutomator shut down normally\r\n[UiAutomator] Moving to state 'stopped'\r\n[ADB] Attempting to kill all uiautomator processes\r\n[ADB] Getting all processes with uiautomator\r\n[ADB] Getting connected devices...\r\n[ADB] 1 device(s) connected\r\n[ADB] Running 'C:\\Users\\MY PC\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' with args: [\"-P\",5037,\"-s\",\"75c26c4c\",\"shell\",\"ps\"]\r\n[ADB] No uiautomator process found to kill, continuing...\r\n[UiAutomator] Moving to state 'stopped'\r\n[Logcat] Stopping logcat capture\r\n[ADB] Getting connected devices...\r\n[ADB] 1 device(s) connected\r\n[ADB] Running 'C:\\Users\\MY PC\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe' with args: [\"-P\",5037,\"-s\",\"75c26c4c\",\"shell\",\"am\",\"force-stop\",\"io.appium.unlock\"]\r\n[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.\r\n[BaseDriver] Event 'quitSessionFinished' logged at 1511594916196 (12:58:36 GMT+0530 (India Standard Time))\r\n[MJSONWP] Received response: null\r\n[MJSONWP] But deleting session, so not returning\r\n[MJSONWP] Responding to client with driver.deleteSession() result: null\r\n[HTTP] <-- DELETE /wd/hub/session/e882bb91-88c9-40eb-a416-22e06705677c 200 7729 ms - 76 \r\n\r\n## Code To Reproduce Issue [ Good To Have ]\r\n\r\nOne Class File  :  \r\npackage com.patient.pages;\r\n\r\nimport java.util.concurrent.TimeUnit;\r\n\r\nimport org.openqa.selenium.WebDriver;\r\nimport org.openqa.selenium.support.PageFactory;\r\nimport org.openqa.selenium.support.pagefactory.FieldDecorator;\r\nimport io.appium.java_client.MobileElement;\r\nimport io.appium.java_client.android.AndroidDriver;\r\nimport io.appium.java_client.android.AndroidElement;\r\nimport io.appium.java_client.pagefactory.AndroidFindBy;\r\nimport io.appium.java_client.pagefactory.AppiumFieldDecorator;\r\n\r\npublic class SelectionScreen {\r\n\t\r\n\tpublic static final String packageName = \"com.appotek.patient\";\r\n\tAndroidDriver<MobileElement> driver;\r\n\t \r\n\t public SelectionScreen(WebDriver driver){\r\n\t  this.driver = (AndroidDriver<MobileElement>)driver;\r\n\t  PageFactory.initElements(new AppiumFieldDecorator(driver), this);\r\n\t }\r\n\t \r\n\t \r\n\t @AndroidFindBy(id=packageName+\":id/text_country\")\r\n\t MobileElement btncountrycode;\r\n\t \r\n\t \r\n\t public void clickOnCountryCode() throws InterruptedException\r\n\t {\r\n\t\t btncountrycode.click();\r\n\t\t \r\n\t\r\n\t\t \r\n     }\r\n}\r\n\r\n\r\n\r\nSecond Class File  Test Case:\r\n\r\npackage com.patient.test;\r\n\r\nimport java.util.concurrent.TimeUnit;\r\n\r\nimport org.openqa.selenium.By;\r\nimport org.openqa.selenium.WebDriver;\r\nimport org.testng.annotations.AfterMethod;\r\nimport org.testng.annotations.BeforeMethod;\r\nimport org.testng.annotations.Test;\r\n\r\nimport com.patient.pages.SelectionScreen;\r\nimport com.patient.setup.AppLaunch;\r\n\r\n\r\npublic class SelectionScreenTestCases \r\n\r\n{\r\n\t\r\n\t\r\n\t\r\n\tWebDriver driver;\r\n\tAppLaunch applaunch;\r\n\tSelectionScreen SSScreen;\r\n\t\r\n\t\r\n\t\r\n\t@BeforeMethod\r\n\tpublic void startapplication() throws InterruptedException\r\n\t{\r\n\t\tapplaunch= new AppLaunch(driver);\r\n\t\t\r\n\t\tthis.driver=applaunch.launchApplication();\r\n\t\tThread.sleep(10000);\r\n\t\t\r\n\t\t\t\t\r\n\t}\r\n\t\r\n\t\r\n\t@Test\r\n\tpublic void verifyCountry() throws InterruptedException\r\n\t{\r\n\t\t\r\n\t\t\r\n\t\tThread.sleep(2000);\r\n\t\tSSScreen = new SelectionScreen(driver);\r\n\t\tThread.sleep(10000);\r\n\t\tSSScreen.clickOnCountryCode();\r\n\t\tThread.sleep(10000);\r\n\t\t\r\n\t}\r\n\t\r\n\r\n\t@AfterMethod\r\n\tpublic void closeApplication()\r\n\t{\r\n\t\tdriver.quit();\r\n\t}\r\n\t\r\n\t\r\n}\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"mykola-mokhnach"}}