How to catch user even (click on a button) from windows UWP app while running WinAppDriver (Appium)

Viewed 52

I need to catch user even and perform some script after it while driver is running

What I want to solve:

  1. Run auto test on UWP app via WinAppDriver

  2. Perform some steps

  3. Wait for user input

  4. If button clicked -> do script, else user continue using app

    import { driver, By2, windowsAppDriverCapabilities } from 'selenium-appium'    
    const capabilites = windowsAppDriverCapabilities(<WinAppId>);
    
    driver.startWithCapabilities(capabilites, 'http://localhost:4723/wd/hub');
    ...
    let someButton = driver.findElement(By2.nativeXpath("//*/ButtonPosition"))
    
    while (true){
      someButton.addEventListener('click', function() {
       <somelogic>
      })
    

TypeError: test.addEventListener is not a function

ā— Test suite failed to run

WebDriverError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: read ECONNRESET

0 Answers
Related