How to click on an element with Python-Behave?

How can I click on an element with Python-Behave?

Hello Macy,

We do have a sample code snippet that you can refer to click on an element with Python-Behave. Here’s the sample below:


@given('I go to sample-todo-app to add item')
def step(context):
    before_all(context)
    context.driver.get('https://lambdatest.github.io/sample-todo-app/')
 
@then('I Click on first checkbox and second checkbox')
def click_on_checkbox_one(context):
    context.driver.find_element_by_name('li1').click()
    context.driver.find_element_by_name('li2').click()