I select particular number of item in selection on Lettuce test


I select particular number of item in selection on Lettuce test and simply by:

1
2
3
4
@step(‘I select item "([^"]*)" from "([^"]*)"’)
def i_select_item_number_from_select(step, number, select_name):
    world.browser.find_by_xpath(‘//select[@name="%s"]/option[%s]’ %
                                (select_name, number)).click()

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.