{"action":"created","issue":{"url":"https://api.github.com/repos/ncbi/robotframework-pageobjects/issues/48","labels_url":"https://api.github.com/repos/ncbi/robotframework-pageobjects/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/ncbi/robotframework-pageobjects/issues/48/comments","events_url":"https://api.github.com/repos/ncbi/robotframework-pageobjects/issues/48/events","html_url":"https://github.com/ncbi/robotframework-pageobjects/pull/48","id":87791123,"number":48,"title":"Fix for attempted screenshots in get_keyword_names","user":{"login":"frishberg","id":2236739,"avatar_url":"https://avatars.githubusercontent.com/u/2236739?v=3","gravatar_id":"","url":"https://api.github.com/users/frishberg","html_url":"https://github.com/frishberg","followers_url":"https://api.github.com/users/frishberg/followers","following_url":"https://api.github.com/users/frishberg/following{/other_user}","gists_url":"https://api.github.com/users/frishberg/gists{/gist_id}","starred_url":"https://api.github.com/users/frishberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frishberg/subscriptions","organizations_url":"https://api.github.com/users/frishberg/orgs","repos_url":"https://api.github.com/users/frishberg/repos","events_url":"https://api.github.com/users/frishberg/events{/privacy}","received_events_url":"https://api.github.com/users/frishberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-12T17:09:17Z","updated_at":"2015-06-12T17:38:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ncbi/robotframework-pageobjects/pulls/48","html_url":"https://github.com/ncbi/robotframework-pageobjects/pull/48","diff_url":"https://github.com/ncbi/robotframework-pageobjects/pull/48.diff","patch_url":"https://github.com/ncbi/robotframework-pageobjects/pull/48.patch"},"body":"Summary of the problem:\r\n\r\nVersion 1.3.0 (which was rolled back) causes a screenshot warning whenever components are used. This also breaks output.xml. This happens because get_keyword_names is called on every Page subclass when Robot loads it: https://github.com/ncbi/robotframework-pageobjects/blob/1.2.1/robotpageobjects/page.py#L209 get_keyword_names iterates over all public members of the class, including @properties. https://github.com/ncbi/robotframework-pageobjects/blob/1.2.1/robotpageobjects/base.py#L56 Retrieving a @property member from a class causes its immediate evaluation. The problem with this is that some properties (such as those automatically added to point to component instances) require an open browser (driver) before they can be evaluated. We therefore wrap the getattr call that retrieves these properties in a try/except. The problem with that is that the run-on-failure decorator still fires within the try, attempting a screenshot, which fails because there is no open browser, and the warning that it failed is still logged.\r\n\r\nThis wasn't a problem in the old version of RF-PO, because the run-on-failure keyword was set to \"None\", so that no screenshot was attempted within the try. It was set to \"None\" as a workaround for the bug where multiple screenshots were attempted when one keyword wrapped another keyword. Now that that is no longer necessary, the workaround was taken out, but that caused this bug. Blargh.\r\n\r\nAs for why the travis build passed, I suspect it's because all our tests passed, warning and busted output files or no.\r\n\r\nThis fix prevents the screenshot attempt within the aforementioned try/except by setting the {{_has_run_on_failure}} property to {{False}} (see the diff)."},"comment":{"url":"https://api.github.com/repos/ncbi/robotframework-pageobjects/issues/comments/111570072","html_url":"https://github.com/ncbi/robotframework-pageobjects/pull/48#issuecomment-111570072","issue_url":"https://api.github.com/repos/ncbi/robotframework-pageobjects/issues/48","id":111570072,"user":{"login":"kahunacohen","id":1248329,"avatar_url":"https://avatars.githubusercontent.com/u/1248329?v=3","gravatar_id":"","url":"https://api.github.com/users/kahunacohen","html_url":"https://github.com/kahunacohen","followers_url":"https://api.github.com/users/kahunacohen/followers","following_url":"https://api.github.com/users/kahunacohen/following{/other_user}","gists_url":"https://api.github.com/users/kahunacohen/gists{/gist_id}","starred_url":"https://api.github.com/users/kahunacohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kahunacohen/subscriptions","organizations_url":"https://api.github.com/users/kahunacohen/orgs","repos_url":"https://api.github.com/users/kahunacohen/repos","events_url":"https://api.github.com/users/kahunacohen/events{/privacy}","received_events_url":"https://api.github.com/users/kahunacohen/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T17:38:23Z","updated_at":"2015-06-12T17:38:23Z","body":":+1: "}}