{"action":"created","issue":{"url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium/issues/14","repository_url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium","labels_url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium/issues/14/comments","events_url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium/issues/14/events","html_url":"https://github.com/saikrishna321/PageObjectPatternAppium/issues/14","id":169562598,"number":14,"title":"Question: How to implement add MobileElement a description annotation","user":{"login":"ansonliao","id":6060224,"avatar_url":"https://avatars.githubusercontent.com/u/6060224?v=3","gravatar_id":"","url":"https://api.github.com/users/ansonliao","html_url":"https://github.com/ansonliao","followers_url":"https://api.github.com/users/ansonliao/followers","following_url":"https://api.github.com/users/ansonliao/following{/other_user}","gists_url":"https://api.github.com/users/ansonliao/gists{/gist_id}","starred_url":"https://api.github.com/users/ansonliao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansonliao/subscriptions","organizations_url":"https://api.github.com/users/ansonliao/orgs","repos_url":"https://api.github.com/users/ansonliao/repos","events_url":"https://api.github.com/users/ansonliao/events{/privacy}","received_events_url":"https://api.github.com/users/ansonliao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2016-08-05T09:06:38Z","updated_at":"2016-08-09T15:16:43Z","closed_at":null,"body":"Hi @saikrishna321 \r\nI would like to make extentreport more detail in test step/operation.\r\n\r\nI created a annotation name `@ElementDescription` for `MobileElement`, and in `page` class, log the mobile element's description to extentreport.\r\n\r\nfor example, for this repository project `PageObjectPatternAppium`, the page class `LoginPage.java`, and page object `LoginPageObjects.java`:\r\n\r\nAdd `@ElementDescription` to MobileElement `sign_in`:\r\n\r\n```java\r\npublic class LoginPageObjects {\r\n    ...\r\n    @AndroidFindBy(xpath = \".//*[@text='Sign in']\") \r\n    @iOSFindBy(id = \"Sign In\")\r\n    @ElementDescription(\"Login Page: SignIn Button\")\r\n    public MobileElement sign_in;\r\n    ...\r\n}\r\n```\r\n\r\nIn `com.appium.pages.LoginPage.java`, define a method named `clickSignInBtn()`, and add extentreport log function into it, so that more easier to trace the test step/operation and more easier to debug the failure by non-programming skill tester:\r\n\r\n```java\r\npublic class LoginPage extends CommonAppiumTest {\r\n    ...\r\n    public LoginPageObjects loginPageObjects = new LoginPageObjects();\r\n\r\n    public LoginPage(AppiumDriver<MobileElement> driver) {\r\n        ....\r\n    }\r\n\r\n    ....\r\n\r\n    public void clickSignInBtn() {\r\n        // how to retrieve mobile element reference loginPageObjects.sign_in description here\r\n        String elementDescription = null;     // How_To_Get_Sign_in_MobileElement_Description\r\n\r\n        // Log test step/test operation by extentreport instance\r\n        ExtentTestManager.getTest().log(LogStatus.INFO, \"Click: \" + elementDescription);\r\n        loginPageObjects.sign_in.click()\r\n    }\r\n}\r\n```\r\n\r\ncould you advise that how I can retrieve  loginPageObjects.sign_in 's description in method `clickSignInBtn()`?"},"comment":{"url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium/issues/comments/238586470","html_url":"https://github.com/saikrishna321/PageObjectPatternAppium/issues/14#issuecomment-238586470","issue_url":"https://api.github.com/repos/saikrishna321/PageObjectPatternAppium/issues/14","id":238586470,"user":{"login":"saikrishna321","id":4045041,"avatar_url":"https://avatars.githubusercontent.com/u/4045041?v=3","gravatar_id":"","url":"https://api.github.com/users/saikrishna321","html_url":"https://github.com/saikrishna321","followers_url":"https://api.github.com/users/saikrishna321/followers","following_url":"https://api.github.com/users/saikrishna321/following{/other_user}","gists_url":"https://api.github.com/users/saikrishna321/gists{/gist_id}","starred_url":"https://api.github.com/users/saikrishna321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saikrishna321/subscriptions","organizations_url":"https://api.github.com/users/saikrishna321/orgs","repos_url":"https://api.github.com/users/saikrishna321/repos","events_url":"https://api.github.com/users/saikrishna321/events{/privacy}","received_events_url":"https://api.github.com/users/saikrishna321/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T15:16:43Z","updated_at":"2016-08-09T15:16:43Z","body":"Okays.... keeping it simple, you have pulled these classes because of JENKINS remote URL config ... if yes, then I can work on it ... so that you can always have the master code..."}}
{"actor":{"display_login":"saikrishna321"}}