0

I'm trying to get the text from a text input. I understand from Stackoverflow that I should use getAttribute('value'). This is what I'm trying but it's not working (below). I get the error:

AttributeError: 'WebElement' object has no attribute 'getAttribute'

audience_panel = self.browser.find_element_by_id('input-panel')
network_text = audience_panel.find_element_by_id('network-code')
self.assertEqual(network_text.getAttribute("value"), "ABC")

enter image description here

Guy
  • 46,488
  • 10
  • 44
  • 88
NewToJS
  • 2,011
  • 4
  • 35
  • 62

1 Answers1

3

getAttribute() is Java syntax. Try get_attribute() instead.

Guy
  • 46,488
  • 10
  • 44
  • 88