NAVDEMO / RunTests

5 stars 7 forks source link

Cannot open page 130409. You might need to import the page object here: http://aka.ms/pstesttoolfob #8

Closed kine closed 5 years ago

kine commented 5 years ago

I am getting error: ''' Cannot open page 130409. You might need to import the page object here: http://aka.ms/pstesttoolfob ''' When running tests from CI pipeline, because the Get-Tests function is called without parameter testPage in function GetTestsFromNavContainer.

The resulting error is non-sense, because page 130409 is not part of the pstesttoolfob.

There are two solutions: a) Add parameter with testpage 61266 into Get-TestsFromNavContainer b) Change default in Get-Tests function

Which you preffer @freddydk ? I will do the PR...

kine commented 5 years ago

Just want's to add that the function Get-TestsFromNavContainer is from navcontainerhelper, this issue is related to this module too.

freddydk commented 5 years ago

The error is wrong should have said: https://aka.ms/pstesttoolpagefob. That is actually the fob that is downloaded in Get-TestsFromNavContainer - and from Run-TestsInNavContainer.

freddydk commented 5 years ago
If (!(Test-Path -Path $PsTestToolFolder -PathType Container)) {
    try {
        New-Item -Path $PsTestToolFolder -ItemType Directory | Out-Null

        Download-File -sourceUrl "https://aka.ms/pstestfunctionsps1" -destinationFile $PsTestFunctionsPath
        Download-File -sourceUrl "https://aka.ms/clientcontextps1" -destinationFile $ClientContextPath
        Download-File -sourceUrl "https://aka.ms/pstesttoolpagefob" -destinationFile $fobfile

        if ((Get-NavContainerServerConfiguration -ContainerName $containerName ).ClientServicesCredentialType -eq "Windows") {
            Import-ObjectsToNavContainer -containerName $containerName -objectsFile $fobfile
        } else {
            Import-ObjectsToNavContainer -containerName $containerName -objectsFile $fobfile -sqlCredential $credential
        }
    } catch {
        Remove-Item -Path $PsTestToolFolder -Recurse -Force
        throw
    }
}

Maybe the folder existed already???

kine commented 5 years ago

Hmm interesting, the output is showing that the fob was imported correctly...

And sorry, I didn't notice that now it is another fob and page ID...

Full output is this:

Running tests in container through navcontainerhelper...
Downloading C:\ProgramData\NavContainerHelper\Extensions\BC\PsTestTool\PsTestFunctions.ps1
Downloading C:\ProgramData\NavContainerHelper\Extensions\BC\PsTestTool\ClientContext.ps1
Downloading C:\ProgramData\NavContainerHelper\Extensions\BC\PsTestTool\PSTestToolPage.fob
Importing Objects from C:\ProgramData\NavContainerHelper\Extensions\BC\PsTestTool\PSTestToolPage.fob (container path)
Objects successfully imported
Creating user manager\containeradministrator as user
Cannot open page 130409. You might need to import the page object here: http://aka.ms/pstesttoolfob
At C:\Users\adm_ksacek\Documents\WindowsPowerShell\Modules\navcontainerhelper\0.5.0.5\ContainerHandling\Invoke-ScriptIn
NavContainer.ps1:30 char:9
+         Invoke-Command -Session $session -ScriptBlock $scriptblock -A ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Cannot open pag...s/pstesttoolfob:String) [], RuntimeException
    + FullyQualifiedErrorId : Cannot open page 130409. You might need to import the page object here: http://aka.ms/ps 
   testtoolfob
kine commented 5 years ago

The container is removed and recreated each build. I will try to cleanup the navcontainerhlper folder...

freddydk commented 5 years ago

Hmmm - maybe a license problem - could you try to open 130409 in web client?

freddydk commented 5 years ago

The container is removed and recreated each build. I will try to cleanup the navcontainerhlper folder...

The folder is part of the container folder - will be deleted with the container

kine commented 5 years ago

Hmm, I repeated the build and now it is ok. Should be some problem just when it was running.

Thanks for help. Seems running now. The failing build was triggered 2019-03-06·16:50. May be it was before the navcontainerhelper was updated on the server or something.

Solved...

freddydk commented 5 years ago

maybe that build was exactly during my checkin, but I should have made sure that people using the old navcontainerhelper uses the pstestrunner.ps1 + pstesttool.fob and the new version uses pstestfunctions.ps1 + pstesttoolpage.fob (you know - I cannot make sure that everybody updates at the same time:-))