0

I am not sure if this is winapp driver or appium server issue. Looking for advise here for the robotframework test run failure about Object reference not set to an instance of an object.

TEST TC001-About-Version
Full Name:  Test-001-About.TC001-About-Version
Start / End / Elapsed:  20221012 09:09:06.088 / 20221012 09:09:10.260 / 00:00:04.172
Status: FAIL
Message:    Setup failed:
Message: Object reference not set to an instance of an object.
00:00:03.905SETUP Keywords . Test Setup About
Start / End / Elapsed:  20221012 09:09:06.089 / 20221012 09:09:09.994 / 00:00:03.905
00:00:00.007KEYWORD Keywords . Start Simulator
00:00:03.895KEYWORD Keywords . Start App
Start / End / Elapsed:  20221012 09:09:06.097 / 20221012 09:09:09.992 / 00:00:03.895
00:00:00.009KEYWORD ApplicationLibrary.DesktopLibrary . Driver Setup ${WinAppDriver}
Documentation:  
Starts the WinAppDriver.

Start / End / Elapsed:  20221012 09:09:06.097 / 20221012 09:09:06.106 / 00:00:00.009
00:00:03.884KEYWORD ApplicationLibrary.DesktopLibrary . Open Application ${REMOTE_URL}, alias=TESTAPP, platformName=Window, deviceName=Windows, app=${APP}, splash_delay=20
Documentation:  
Opens a new application to given Appium server. If your application has a splash screen please supply the window name of the final window that will appear. For the capabilities of appium server and Windows please check http://appium.io/docs/en/drivers/windows

Start / End / Elapsed:  20221012 09:09:06.106 / 20221012 09:09:09.990 / 00:00:03.884

The test uses ApplicationLibrary.DesktopLibrary

*** Settings ***
Library    ApplicationLibrary.DesktopLibrary
Library    String
Library     OperatingSystem
Library    Process
Resource   ../Resources/Elements.robot
Resource   ../Resources/Parameters.robot


*** Keywords ***


#************* Initialization ****************
#Test Setup
#     Start Simulator
#     Start App
#     Health Check

Start Simulator
    Start Process    ${Simulator}   alias=Simulator

Start App
    Driver Setup    ${WinAppDriver}
    Open Application    ${REMOTE_URL}   alias=TESTAPP   platformName=Window     deviceName=Windows  app=${APP}    splash_delay=20

Health Check
    Switch Application      TESTAPP
    Wait Until Page Contains Element    ${txt_system_status}   timeout=10s

#************* Landing Page ****************
Click On Hamburger Menu
    Wait Until Element Is Visible    ${btn_hamburger}   timeout=60s
    @{elements}     Get Webelements     ${btn_hamburger}
    ${a}=   Get Length    ${elements}
    Click Element    ${elements}[2]


#************* About Page ****************
Click On About
    Wait Until Element Is Visible    ${btn_about}
    Click Element    ${btn_about}

Verify Version From File
    [Arguments]     ${file}
    ${TextFileContent}=     Get File     ${file}
    ${version}=     Strip String    ${TextFileContent}
    Set Test Variable    ${version}
    Page Should Contain Element    //*[@Name='${version}']

Test Setup About
    Start Simulator
    Start App
    Health Check

Test Teardown About
    Run Keyword If Test Failed    Capture Page Screenshot
    Run Keyword And Continue On Failure     Quit Application

Script:

*** Settings ***
Library     OperatingSystem
Library     ApplicationLibrary.DesktopLibrary
Library     Process
Resource    ../Resources/Parameters.robot
Resource    ../Resources/Elements.robot
Resource    ../Resources/Keywords.robot
Suite Teardown    Driver Teardown
Test Setup        Test Setup About
Test Teardown     Test Teardown About


*** Test Cases ***
TC001-About-Version
    Click On Hamburger Menu
    Click On About
    Verify Version From File    ${productversion}

the other error occured about "NoSuchWindowException: Message: Currently selected window has been closed". this happened randomly too.

    TEST TC001-About-Version
Full Name:  Test-001-About.TC001-About-Version
Start / End / Elapsed:  20221012 09:23:39.213 / 20221012 09:23:44.194 / 00:00:04.981
Status: FAIL
Message:    Setup failed:
NoSuchWindowException: Message: Currently selected window has been closed


Also teardown failed:
Several failures occurred:

1) NoSuchWindowException: Message: Currently selected window has been closed


2) NoSuchWindowException: Message: Currently selected window has been closed
00:00:04.954SETUP Keywords . Test Setup About
Start / End / Elapsed:  20221012 09:23:39.213 / 20221012 09:23:44.167 / 00:00:04.954
00:00:00.004KEYWORD Keywords . Start Simulator
Start / End / Elapsed:  20221012 09:23:39.214 / 20221012 09:23:39.218 / 00:00:00.004
00:00:00.003KEYWORD Process . Start Process ${Simulator}, alias=Simulator
Documentation:  
Starts a new process on background.

Start / End / Elapsed:  20221012 09:23:39.214 / 20221012 09:23:39.217 / 00:00:00.003
09:23:39.214    INFO    Starting process:
"C:\Program Files\TESTAPP\Simulator\Simulator.exe"  
00:00:02.967KEYWORD Keywords . Start App
Start / End / Elapsed:  20221012 09:23:39.218 / 20221012 09:23:42.185 / 00:00:02.967
00:00:00.004KEYWORD ApplicationLibrary.DesktopLibrary . Driver Setup ${WinAppDriver}
Documentation:  
Starts the WinAppDriver.

Start / End / Elapsed:  20221012 09:23:39.218 / 20221012 09:23:39.222 / 00:00:00.004
00:00:02.963KEYWORD ApplicationLibrary.DesktopLibrary . Open Application ${REMOTE_URL}, alias=TESTAPP, platformName=Window, deviceName=Windows, app=${APP}, splash_delay=20
Documentation:  
Opens a new application to given Appium server. If your application has a splash screen please supply the window name of the final window that will appear. For the capabilities of appium server and Windows please check http://appium.io/docs/en/drivers/windows

Start / End / Elapsed:  20221012 09:23:39.222 / 20221012 09:23:42.185 / 00:00:02.963
09:23:42.185    INFO    A
B   
00:00:01.981KEYWORD Keywords . Health Check
Start / End / Elapsed:  20221012 09:23:42.185 / 20221012 09:23:44.166 / 00:00:01.981
00:00:00.000KEYWORD ApplicationLibrary.DesktopLibrary . Switch Application TESTAPP
Documentation:  
Switches the active application by index or alias.

Start / End / Elapsed:  20221012 09:23:42.185 / 20221012 09:23:42.185 / 00:00:00.000
00:00:01.981KEYWORD ApplicationLibrary.DesktopLibrary . Wait Until Page Contains Element ${txt_system_status}, timeout=10s
Documentation:  
Waits until element specified with `locator` appears on current page.

Start / End / Elapsed:  20221012 09:23:42.185 / 20221012 09:23:44.166 / 00:00:01.981
00:00:00.007KEYWORD ApplicationLibrary.DesktopLibrary . Save Appium Screenshot
Documentation:  
Takes a screenshot with a unique filename to be stored in Robot Framework compiled reports.

Start / End / Elapsed:  20221012 09:23:44.157 / 20221012 09:23:44.164 / 00:00:00.007
09:23:44.162    FAIL    NoSuchWindowException: Message: Currently selected window has been closed
09:23:44.165    WARN    Keyword 'Save Appium Screenshot' could not be run on failure: NoSuchWindowException: Message: Currently selected window has been closed
09:23:44.165    FAIL    NoSuchWindowException: Message: Currently selected window has been closed
00:00:00.027TEARDOWN Keywords . Test Teardown About
user2201789
  • 1,083
  • 2
  • 20
  • 45

0 Answers0