seleniumautomated-testsqaf

Windows application automation using QAF


I'm looking support for automate windows application like notepad using Qmetry automation framework with BDD steps. is there any link or solution to implement. I tried with Appium driver but didn't work.

Step1: open Notepad Step2: enter "Some text"[enter link description here][1]

Success log: Windows Application Driver listening for requests at: http://127.0.0.1:4723/ Press ENTER to exit.

========================================== POST /session HTTP/1.1 Accept-Encoding: gzip,deflate Connection: Keep-Alive Content-Length: 258 Content-Type: application/json; charset=utf-8 Host: 127.0.0.1:4723 User-Agent: Apache-HttpClient/4.5.2 (Java/16.0.2)

{"capabilities":[{"desiredCapabilities":{"app":"C:\Windows\System32\notepad.exe","platformName":"Windows"}},{"requiredCapabilities":{}}],"desiredCapabilities":{"app":"C:\Windows\System32\notepad.exe","platformName":"Windows"},"requiredCapabilities":{}} HTTP/1.1 200 OK Content-Length: 141 Content-Type: application/json

========================================== GET /session/3E4610D7-9EBB-4998-921B-94220578D3F1 HTTP/1.1 Accept-Encoding: gzip,deflate Cache-Control: no-cache Connection: Keep-Alive Host: 127.0.0.1:4723 User-Agent: Apache-HttpClient/4.5.2 (Java/16.0.2)

HTTP/1.1 200 OK Content-Length: 90 Content-Type: application/json

{"status":0,"value":{"app":"C:\Windows\System32\notepad.exe","platformName":"Windows"}}


Failure log:

Windows Application Driver listening for requests at: http://127.0.0.1:4723/ Press ENTER to exit.

========================================== POST /wd/hub/session HTTP/1.1 Accept-Encoding: gzip Connection: Keep-Alive Content-Length: 641 Content-Type: application/json; charset=utf-8 Host: 127.0.0.1:4723 User-Agent: selenium/3.141.59 (java windows) X-Idempotency-Key: 202d0858-641b-4263-88b9-4b5b1ed0ecc1


Solution

  • You didn't provided what you tried and what is the error you are getting.

    In order to automate windows native application you need to use appium windows driver. Windows driver is appium implementation so you can use it like android or ios appium driver.

    You can refer

    EDIT: Below sample works fine:

    Properties for setting capabilities

    remote.port=4723
    driver.name= appiumDriver
    
    appium.additional.capabilities={"app":"C:\\Windows\\System32\\notepad.exe","driverClass":"io.appium.java_client.windows.WindowsDriver"}
    #appium.capabilities.driverClass=io.appium.java_client.windows.WindowsDriver
    #appium.capabilities.app=C:\\Windows\\System32\\notepad.exe
    

    It worked well as normal web driver test without issue:

    import static com.qmetry.qaf.automation.step.CommonStep.sendKeys;
    import static com.qmetry.qaf.automation.util.StringMatcher.exact;
    import static com.qmetry.qaf.automation.ui.webdriver.ElementFactory.$;
    
    ...
    
        @Test
        public void testCanEditInNotpad(){
            getDriver().verifyTitle(exact("Untitled - Notepad"));
            getDriver().findElementByClassName("Edit").sendKeys("it worked!...")
            $("className=Edit").sendKeys(" This also worked!...");
            sendKeys(" Common Step worked as well!...", "className=Edit");
        }