Hi guys I want to get the text from element which is disabled.It's value depends upon the domain of email address I fill during sign up.The HTML code for the element is:
<select _ngcontent-thq-32="" class="form-control formInputHeight ng-untouched ng-pristine" data-dropdownjs="true" id="compName" name="companyId" required="" disabled="">
<option _ngcontent-thq-32="" disabled="disabled" selected="selected" value="0">Company Name</option>
<!--template bindings={}-->
</select>
And the Python code I'm using to get the text from this element is:
disabled_input_field = driver.find_element_by_xpath('//*[@id="compName"]')
value = disabled_input_field.get_attribute('value')
return value
But everytime my test case fails.Please suggest the correct method of doing so.