Tuesday 18 March 2014

Reading data from the webpage in selenium webdriver in python - Example

Selenium API provides 2 important methods to read data from web elements.
  1. value_of_css_property – gets the value of css property of the element
  2. get_attribute – gets the value of given attribute.
We can also get the inner text of element using text property.

We can also check if
  1. Element is displayed using is_displayed mehtod
  2. Element is selected using is_selected method
  3. Element is enabled using is_enabled method
x = e.value_of_css_property("width");
x = e.get_attribute("onfocus");

x = e.is_selected();
x = e.is_displayed();
x = e.isEnabled();

What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com

No comments:

Post a Comment

Buy Best Selenium Books

Contributors