Im trying to put together a simple playwright script where it will launch a google slides file and auto play/loop in full screen for an announcemnt display we launch every morning. Which is done by interacting with the ‘hidden’ menu that is only visable when you move the mouse close enough to the bottom left of the screen. (Seen screenshot)
Google Slides Screenshot
Here is the function in python.
def run(playwright: Playwright) -> None:
app_data_path = os.getenv("LOCALAPPDATA")
user_data_path = os.path.join(app_data_path, 'Chromium\User Data\Default')
context = playwright.chromium.launch_persistent_context(user_data_path, headless=False, no_viewport=True, args=["--start-fullscreen"])
page = context.new_page()
page.goto("URL to my google slides file")
page.get_by_label("Start slideshow (Ctrl+F5)").click()
page.frame_locator(".punch-present-iframe").get_by_role("button", name="Open the options menu").click()
page.frame_locator(".punch-present-iframe").get_by_role("menuitemcheckbox", name="Loop").click()
page.frame_locator(".punch-present-iframe").get_by_role("menuitemcheckbox", name="Every minute").click()
page.frame_locator(".punch-present-iframe").get_by_role("menuitem", name="Play", exact=True).click()
I have tired using the keybaord (Tab, Enter and arrow keys) to navigate the menu what is only visable when the mouse is close enough to the bottom left corner of the screen but that doesnt work and the process times out.
Im after a way to interact with this menu so I can select the Auto play settings to change slide every minute and loop them.
Faith Family is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.