'Adds a custom location strategy based on a keyword.
Location strategies are automatically removed after leaving the current
scope by default. Setting `persist` to Python True will cause the
location strategy to stay registered throughout the life of the test.
Trying to add a custom location strategy with the same name as one that
already exists will cause the keyword to fail.
Custom locator keyword example:
| Custom Locator Strategy |
|   | [Arguments] | ${browser} | ${criteria} | ${tag} | ${constraints} |
|   | ${retVal}= | Execute Javascript | return window.document.getElementById(\'${criteria}\'); |
|   | [Return] | ${retVal} |
Usage example:
| Add Location Strategy | custom | Custom Locator Strategy |
| Page Should Contain Element | custom=my_id |
See `Remove Location Strategy` for details about removing a custom
location strategy.'

@keyword
def add_location_strategy(self, strategy_name, strategy_keyword, persist=False):

    self.element_finder.register(strategy_name, strategy_keyword, persist)
