{"action":"created","issue":{"url":"https://api.github.com/repos/watir/watir/issues/750","repository_url":"https://api.github.com/repos/watir/watir","labels_url":"https://api.github.com/repos/watir/watir/issues/750/labels{/name}","comments_url":"https://api.github.com/repos/watir/watir/issues/750/comments","events_url":"https://api.github.com/repos/watir/watir/issues/750/events","html_url":"https://github.com/watir/watir/issues/750","id":332822167,"node_id":"MDU6SXNzdWUzMzI4MjIxNjc=","number":750,"title":"Convert to String custom attribute passed as Symbol into #Attribute method","user":{"login":"jff05","id":33236073,"node_id":"MDQ6VXNlcjMzMjM2MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/33236073?v=4","gravatar_id":"","url":"https://api.github.com/users/jff05","html_url":"https://github.com/jff05","followers_url":"https://api.github.com/users/jff05/followers","following_url":"https://api.github.com/users/jff05/following{/other_user}","gists_url":"https://api.github.com/users/jff05/gists{/gist_id}","starred_url":"https://api.github.com/users/jff05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jff05/subscriptions","organizations_url":"https://api.github.com/users/jff05/orgs","repos_url":"https://api.github.com/users/jff05/repos","events_url":"https://api.github.com/users/jff05/events{/privacy}","received_events_url":"https://api.github.com/users/jff05/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-15T15:37:09Z","updated_at":"2018-06-18T14:06:56Z","closed_at":"2018-06-18T06:49:56Z","author_association":"NONE","body":"## Meta -\r\nWatir Version: 6.11.0\r\nSelenium Version: 3.12.0\r\nBrowser Version: FF 60.0.2\r\nBrowser Driver Version: \r\nOS Version: Windows 7\r\n\r\n## Expected Behavior -\r\nI would like to be able to pass on to the #Attribute method a custom attribute by Symbol such as :data_*\r\nrather than by its String that would be 'data-*'\r\n\r\n`puts elmt.attribute('data-widgetapplicationid').nil?`\r\n#=> false\r\n`puts elmt.attribute('data-widgetapplicationid')`\r\n#=> Application.413\r\n\r\n`puts elmt.attribute(:data_widgetapplicationid).nil?`\r\n#=>  false\r\n`puts elmt.attribute(:data_widgetapplicationid)`\r\n#=>  Application.413\r\n\r\n\r\n## Actual Behavior -\r\nCurrently if I do pass my custom attribute by Symbol, no error is being thrown but my attribute is not being recognized as it would be as a String.\r\n\r\n`puts elmt.attribute('data-widgetapplicationid').nil?`\r\n#=> false\r\n`puts elmt.attribute('data-widgetapplicationid')`\r\n#=> Application.413\r\n\r\n`puts elmt.attribute(:data_widgetapplicationid).nil?`\r\n**#=>  true**\r\n`puts elmt.attribute(:data_widgetapplicationid)`\r\n**#=>  nil**\r\n\r\n\r\n## Steps to reproduce -\r\n`<div id=\"1\" data-widgetapplicationid=\"Application.413\">text</div>`\r\n\r\n`puts browser.div(id: '1').attribute('data-widgetapplicationid').nil?`\r\n#=> false\r\n`puts browser.div(id: '1').attribute('data-widgetapplicationid')`\r\n#=> Application.413\r\n\r\n`puts browser.div(id: '1').attribute(:data_widgetapplicationid).nil?`\r\n**#=>  true**\r\n`puts browser.div(id: '1').attribute(:data_widgetapplicationid)`\r\n**#=>  nil**\r\n"},"comment":{"url":"https://api.github.com/repos/watir/watir/issues/comments/398066121","html_url":"https://github.com/watir/watir/issues/750#issuecomment-398066121","issue_url":"https://api.github.com/repos/watir/watir/issues/750","id":398066121,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODA2NjEyMQ==","user":{"login":"jff05","id":33236073,"node_id":"MDQ6VXNlcjMzMjM2MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/33236073?v=4","gravatar_id":"","url":"https://api.github.com/users/jff05","html_url":"https://github.com/jff05","followers_url":"https://api.github.com/users/jff05/followers","following_url":"https://api.github.com/users/jff05/following{/other_user}","gists_url":"https://api.github.com/users/jff05/gists{/gist_id}","starred_url":"https://api.github.com/users/jff05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jff05/subscriptions","organizations_url":"https://api.github.com/users/jff05/orgs","repos_url":"https://api.github.com/users/jff05/repos","events_url":"https://api.github.com/users/jff05/events{/privacy}","received_events_url":"https://api.github.com/users/jff05/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T14:06:56Z","updated_at":"2018-06-18T14:06:56Z","author_association":"NONE","body":"@p0deje If I opened this issue, it is not about me not being able to do what I want to achieve, I also provided myself with a different solution to my problem.\r\nThis issue was meant to make the use of Watir #Attribute method more \"general\".\r\n\r\nWhen Watir contains the below in /element_locator_spec.rb:\r\n     ` it \"handles selector with attribute presence\" do`\r\n       `  expect_one :xpath, \".//*[@data-view]\"`\r\n       `  locate_one [:data_view, true]`\r\n     ` end`\r\n\r\nIt lets the user define a Key locator as described, then why not treat that Key locator as any other?\r\nIf there is any good argument against it, then I would say it should fire up an error otherwise it becomes confusing for a newbie like me at least."}}
{"actor":{"display_login":"jff05"}}