robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

add "Get XPath Count" keyword #86

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by bryan.oakley on 4 Feb 2010

I would like to see a keyword "Get XPath Count" added. I think the implementation would be:

def get_xpath_count(self,xpath):
    """
    Returns the number of nodes that match the specified xpath, eg. 
    "//table" would give the number of tables.
    """
    return self._selenium.get_xpath_count(xpath)

I will be happy to own this but I'd like someone with more knowledge of the library to code-review it.

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 4 Feb 2010

There's already issue 69 about this although it proposes a slightly different keyword name.

The code and documentation above look good, but the should also be some tests. Have you Bryan looked at SeleniumLibs test system and do you think you could add tests for this too? If yes, feel free to grab issue 69 to yourself. If the test system isn't yet adequately documented, Janne could probably enhance that to make it easier for also others to contribute.