Converting getCSS Count Code from java to python
Stefan Behnel
stefan_ml at behnel.de
Fri Feb 18 01:42:55 EST 2011
SMERSH009, 18.02.2011 07:25:
> On Feb 17, 9:51 pm, Stefan Behnel wrote:
>> SMERSH009, 17.02.2011 22:46:
>>> class Untitled(unittest.TestCase):
>>> def count_css_matches(self, css_locator):
>>> java_script_code = '''
>>> var cssMatches = eval_css("%s", window.document);
>>> cssMatches.length;''' % css_locator
>>> return int(selenium.get_eval(self, java_script_code))
>>> #return int(selenium.getEval(java_script_code))
>>
>> You want to use "self.selenium" here, not "selenium".
>
> Wow-- you guys rock --big time! :))
It's just Linus' Law.
http://en.wikipedia.org/wiki/Linus%27_Law
Stefan
More information about the Python-list
mailing list