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

_Demo_NavigateCheckBanner added _WD_LoadWait #394

Merged

Conversation

mlipok
Copy link
Contributor

@mlipok mlipok commented Aug 29, 2022

Pull request

Proposed changes

fixing empty Screen2.png on FF in DemoWindows

Checklist

  • I have read and noticed the CODE OF CONDUCT document
  • I have read and noticed the CONTRIBUTING document
  • I have added necessary documentation or screenshots (if appropriate)

Types of changes

  • Bugfix (change which fixes an issue)
  • Feature (change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (functional, structural)
  • Documentation content changes
  • Other (please describe)

What is the current behavior?

DemosFunction from wd_demo.au3 are not properly waiting for the page to finish loading.
For example using FF i get empty Screen2.png with DemoWindows

What is the new behavior?

after adding _WD_LoadWait to _Demo_NavigateCheckBanner it is fixed

Additional context

I was testing: DemoWindows in wd_demo: review all "Demo****" function
I notice that using FF i get empty Screen2.png

System under test

FF

@Danp2
Copy link
Owner

Danp2 commented Aug 29, 2022

I don't understand why this change is needed as there is already a call to _WD_LoadWait just above this. Can you elaborate?

@mlipok
Copy link
Contributor Author

mlipok commented Aug 29, 2022

I don't understand why this change is needed as there is already a call to _WD_LoadWait just above this. Can you elaborate?

First _WD_LoadWait is waiting before COOKIE acceptance.
After checking COOKIE website is loading additional stuff.

in DemoWindows this code

au3WebDriver/wd_demo.au3

Lines 764 to 772 in c7fd8cf

_Demo_NavigateCheckBanner($sSession, "https://google.com", '//body/div[1][@aria-hidden="true"]')
If @error Then Return SetError(@error, @extended)
$sHnd1 = '{"handle":"' & _WD_Window($sSession, "window") & '"}'
_WD_NewTab($sSession)
$sHnd2 = '{"handle":"' & _WD_Window($sSession, "window") & '"}'
_Demo_NavigateCheckBanner($sSession, "https://yahoo.com", '//body[contains(@class, "blur-preview-tpl")]')
If @error Then Return SetError(@error, @extended)

open new tab immediately without waiting for page is fully loaded.
then switch

_WD_Window($sSession, "switch", $sHnd1)

and switch again and makes screenshot

au3WebDriver/wd_demo.au3

Lines 791 to 792 in c7fd8cf

_WD_Window($sSession, "switch", $sHnd2)
$sResponse = _WD_Window($sSession, 'screenshot')

but this time in FF the page is not loaded.

So I had to add two separate _WD_LoadWait in DemoWindows or make it happen internally in _Demo_NavigateCheckBanner to cover all cases instead only this two in DemoWindows.

@Danp2 Danp2 merged commit 299b127 into Danp2:master Aug 29, 2022
@mlipok mlipok deleted the ml__Demo_NavigateCheckBanner-added-_WD_LoadWait branch August 29, 2022 18:31
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 this pull request may close these issues.

2 participants