Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wd_demo.au3: checking "UserFile" and _WD_GetContext() #461

Closed
mlipok opened this issue Apr 25, 2023 · 4 comments · Fixed by #462
Closed

wd_demo.au3: checking "UserFile" and _WD_GetContext() #461

mlipok opened this issue Apr 25, 2023 · 4 comments · Fixed by #462

Comments

@mlipok
Copy link
Contributor

mlipok commented Apr 25, 2023

Bug report

Describe the bug

I was intend to check how _WD_GetContext() works, in order to continue work on #369

How to reproduce

use wd_demo.au3 with UserFile feature,
to run file usertesting_WD_GetContext.au3 (create on your disc with this following content)

$sArrayHeader = 'Absolute Identifiers > _WD_FrameEnter|Relative Identifiers > _WD_FrameEnter|FRAME attributes|URL|Body ElementID|IsHidden|MatchedElements'

_Demo_NavigateCheckBanner($sSession, "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe", '//*[@id="snigel-cmp-framework" and @class="snigel-cmp-framework"]')
ConsoleWrite("! 1" & @CRLF)

$CONTEXT = _WD_GetContext($sSession)
ConsoleWrite("! 2" & @CRLF)

$a_FrameTest = _WD_FrameList($sSession)
ConsoleWrite("! 3" & @CRLF)

_ArrayDisplay($a_FrameTest, 'Starting', 0, 0, Default, $sArrayHeader)
ConsoleWrite("! 4" & @CRLF)

_WD_FrameEnter($sSession, 'null/0')
ConsoleWrite("! 5" & @CRLF)

$a_FrameTest = _WD_FrameList($sSession)
ConsoleWrite("! 6" & @CRLF)

_ArrayDisplay($a_FrameTest, 'null/0', 0, 0, Default, $sArrayHeader)
ConsoleWrite("! 7" & @CRLF)

_WD_FrameEnter($sSession, $CONTEXT)
ConsoleWrite("! 8" & @CRLF)

$a_FrameTest = _WD_FrameList($sSession)
ConsoleWrite("! 9" & @CRLF)

_ArrayDisplay($a_FrameTest, '$CONTEXT', 0, 0, Default, $sArrayHeader)
ConsoleWrite("! 10" & @CRLF)

I get unexpected results:

+ wd_demo.au3: Running: UserFile
__WD_Post ==> Success [0] : HTTP status = 200
_WD_Navigate ==> Success [0] : Parameters:   URL=https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe
_WD_LoadWait ==> Success [0 / 4] : Parameters:    Delay=Default    Timeout=Default    Element=Default    DesiredState=complete    : ReadyState= complete (Fully loaded)
_WD_WaitElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//*[@id="snigel-cmp-framework" and @class="snigel-cmp-framework"]   Delay=0   Timeout=60000   Options=8
_WD_LoadWait ==> Success [0 / 4] : Parameters:    Delay=Default    Timeout=Default    Element=Default    DesiredState=complete    : ReadyState= complete (Fully loaded)
! 1
! 2
! 3
! 4
__WD_Post ==> Success [0] : HTTP status = 200
_WD_Window ==> Success [0] : Parameters:   Command=frame   Option={"id":null}
__WD_Post ==> Success [0] : HTTP status = 200
_WD_Window ==> Success [0] : Parameters:   Command=frame   Option={"id":0}
_WD_FrameEnter ==> Success [0] : Parameters:    Identifier=null/0
! 5
! 6
! 7
! 8
! 9
! 10
+ wd_demo.au3: Finished: UserFile

Expected behavior

  1. be able to use _ArrayDisplay() to display the results
  2. be able to check how _WD_GetContext() works

Screenshots

none

Additional context

this is first step to continue work on #369

System under test

not related

@Danp2
Copy link
Owner

Danp2 commented Apr 25, 2023

@mlipok
Copy link
Contributor Author

mlipok commented Apr 25, 2023

usertesting_WD_GetContext.au3 modified a little in OP.

@mlipok
Copy link
Contributor Author

mlipok commented Apr 25, 2023

So for now we can only do

ConsoleWrite("! 2" & _WD_GetContext($sSession) & @CRLF)

instead

$CONTEXT = _WD_GetContext($sSession)

@mlipok
Copy link
Contributor Author

mlipok commented Apr 25, 2023

I have a work around in tests.

@Danp2 Danp2 linked a pull request Apr 25, 2023 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants