# Here is an example of solution.
# task: Send Alice the email from Beth / navigate to the message from Beth and send it to Alice.
def solution(agent, start_from=1):
# General plan: I should first click on the email from Beth, then click on the "Forward" button, then type "Alice" in the "To" inputbox, finally click on the "Send" button.
    if start_from <= 1:
        print('[Step 1] click on the email from Beth')
        agent.click_xpath('//*[@class="email-sender" and text()="Beth"]')
        state_after_interaction = agent.click_xpath('//span[@class="email-forward"]')
        # the "To" inputbox should be displayed on page.
        assert 'forward-sender' in state_after_interaction, f'I cannot do [Step 1] correctly. The "To" inputbox is not displayed on the page. Current state: {state_after_interaction}'
    
    if start_from <= 2:
        print('[Step 2] type "Alice" in the "To" inputbox')
        agent.click_xpath('//input[@class="forward-sender"]')
        agent.type('Alice')
        state_after_interaction = agent.click_xpath('//span[@id="send-forward"]')
        # the email should be sent successfully.
        assert 'email-sender' in state_after_interaction, f'I cannot do [Step 2] correctly. The email is not sent successfully. Current state: {state_after_interaction}'
