selenium webdriver - change size for select by javaScript in robot +python -


e = self._current_browser().find_element_by_xpath("//label[text()='" + label + "']/../..//select") print "e:", e self.execute_javascript("return arguments[0].size", e) self.capture_page_screenshot("c:/base.png") self.execute_javascript("arguments[0].size=1", e) 

fail : typeerror: sequence item 1: expected string, webelement found

how solve problem?

it appears label webelement have found using previous selenium find method. in context of find_element_by_xpath("//label[text()='" + label + "']/../..//select") must string. need ask text() part of label , use extract method string need.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -