from marionette_driver import Marionette # Set up a Marionette client client = Marionette() client.start_session() # Navigate to a web page client.navigate('https://www.example.com') # Wait for a button with ID "login-button" to be visible, then tap/click it client.wait_for_element('button#login-button').tap() # Close the session client.close()
from marionette_driver import Wait # Set up a Marionette client client = Marionette() client.start_session() # Navigate to a web page client.navigate('https://www.example.com') # Wait for an element with CSS class "nav-link" to be visible, then tap/click it wait = Wait(client) wait.until(lambda _: client.find_elements('css selector', '.nav-link')) client.find_element('css selector', '.nav-link').tap() # Close the session client.close()In this example, the Marionette client waits for an element with CSS class "nav-link" to be visible. The wait is performed using the Wait object from the Marionette Driver library. Once the element is visible, the client performs a tap/click on it. Package/library used: `marionette_driver`