Building on the question asked in Selenium webdriver: How do I find ALL of an element's attributes?
When I use this answer I get the expected result of the elements attributes. However it isn't current, in other words not what I see on the screen.
For example:
>attrs = driver.execute_script('var items = {}; for (index = 0; index <arguments[0].attributes.length; ++index) { items[arguments[0].attributes[index].name] = arguments[0].attributes[index].value }; return items;', vlan)
>print attrs
{ u'name': u'PixF1InterfaceVLAN', u'value': u'1',}
However if I look at the same element 'vlan':
>vlan.get_attribute("value")
u'10'
Which is what I see on the screen. My question is how can I update the Javascript code so that it shows the correct list of attributes?