Selenium Webdriver python storeTextPresent -


how can perform storetextpresent in selenium webdriver python?

in selenium ide following code works:

storetextpresent regexp:[tt]ext test gotolf storedvars['test'] == true exists 

source:

<tr>     <td>storetextpresent</td>     <td>regexp:[tt]ext</td>     <td>test</td> </tr> <tr>     <td>gotoif</td>     <td>storedvars['test'] == true</td>     <td>exists</td> </tr> 

i want same thing selenium webdriver.

best regards.

i came solution!

self.assertregex(driver.find_element_by_class_name("classname").text,r"^[\s\s]*[tt]ext*$") 

this command tests regex search matches (or not match) text. in case of failure, error message include pattern , text.

best regards.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -