au3WebDriver icon indicating copy to clipboard operation
au3WebDriver copied to clipboard

wd_demo: review all "Demo****" function

Open mlipok opened this issue 2 years ago • 38 comments

Bug report

Describe the bug

This may not be a specific bug, but we have to check all "Demos" step by step on all browsers.

How to reproduce

Run wd_demo.au3 Set debug level to "Error" Select all "Demos" (except UserTesting) and run them image

Expected behavior

Mostly there should not be any errors, but there are exceptions for example "DemoTimeouts" exptect to TimeOut error was fired.

Screenshots

Expected TimeOut error image

Unexpected error: image

Additional context

This bug report is only as a start for disscusion.

System under test

All possible cases. If we will have time.

Progress / summary

  • [ ] DemoTimeouts - on FF works fine but on GoogleChrome/MSEdge/Opera - fires error
  • [x] DemoNavigation - works fine (08 July 2022)
  • [x] DemoElements - works fine (08 July 2022)
  • [x] DemoScript - works fine (08 July 2022)
  • [x] DemoCookies - works fine (07 August 2022) - NID issue is normal behavior take a look at #370
  • [x] DemoAlerts - works fine (08 August 2022) - error from 'check status' is expected behavior #371
  • [x] DemoFrames - works fine (29 August 2022)
  • [x] DemoActions - works fine (08 August 2022)
  • [ ] DemoDownload - isue only on Opera - other works fine
  • [ ] DemoWindows - using FF i get empty Screen2.png
  • [ ] DemoUpload
  • [ ] DemoPrint
  • [x] DemoSleep - works fine (08 August 2022) - there is expected error _WD_WaitElement ==> User Aborted [17]
  • [x] DemoSelectOptions - works fine (07 August 2022) - tested on https://github.com/Danp2/au3WebDriver/pull/367
  • [ ] DemoStyles
  • [x] UserTesting - is not the subject of this review
  • [x] UserFile - is not the subject of this review

mlipok avatar Mar 09 '22 16:03 mlipok

I don't get these errors when running the version of wd_demo in master branch.

Danp2 avatar Mar 09 '22 18:03 Danp2

It depends on driver, browser, windows versions.

mlipok avatar Mar 09 '22 19:03 mlipok

And they are not all.

mlipok avatar Mar 09 '22 19:03 mlipok

It depends on driver, browser, windows versions.

Theoretically, it shouldn't matter. In the real world, we both know that some browsers / drivers occasionally behave differently.

If there are certain combinations that don't work as expected, then you should list them here.

And they are not all.

I'm not sure what you are trying to say here.

Danp2 avatar Mar 09 '22 19:03 Danp2

If there are certain combinations that don't work as expected, then you should list them here.

Thats the plan to check and enlist them.

mlipok avatar Mar 09 '22 20:03 mlipok

If there are certain combinations that don't work as expected, then you should list them here.

Thats the plan to check and enlist them.

I see you start enlisting them here: WD_Demo needs updated

So I propose to close my ISSUE and stick with your's.

mlipok avatar Mar 22 '22 11:03 mlipok

Sorry... I forgot that this issue already existed.

Danp2 avatar Mar 22 '22 11:03 Danp2

No problem now they are connected.

mlipok avatar Mar 22 '22 11:03 mlipok

I will check this on my way. soon....

mlipok avatar Mar 24 '22 11:03 mlipok

FIREFOX: DemoElements

+ wd_demo.au3: Running: DemoElements
- wd_demo.au3: #350 : Element Coords = 237 / 381.5 / 487 / 34
__WD_Post ==> Element interaction issue (14) HTTP status = 400 : ResponseText={"value":{"error":"element not interactable","message":"Element <input class=\"gLFyf gsfi\" name=\"q...
_WD_ElementAction ==> Element interaction issue (14) HTTP status = 400 : {"value":{"error":"element not interactable","message":"Element <input class=\"gLFyf gsfi\" name=\"q\" type=\"text\"> is not reachable by keyboard","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nElementNotInteractableError@chrome://remote/content/shared/webdriver/Errors.jsm:293:5\nwebdriverSendKeysToElement@chrome://remote/content/marionette/interaction.js:624:13\ninteraction.sendKeysToElement@chrome://remote/content/marionette/interaction.js:600:11\nsendKeysToElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:497:24\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:151:31\n"}}
__WD_Post ==> Element interaction issue (14) HTTP status = 400 : ResponseText={"value":{"error":"element not interactable","message":"Element <input class=\"gLFyf gsfi\" name=\"q...
_WD_ElementAction ==> Element interaction issue (14) HTTP status = 400 : {"value":{"error":"element not interactable","message":"Element <input class=\"gLFyf gsfi\" name=\"q\" type=\"text\"> is not reachable by keyboard","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nElementNotInteractableError@chrome://remote/content/shared/webdriver/Errors.jsm:293:5\nwebdriverSendKeysToElement@chrome://remote/content/marionette/interaction.js:624:13\ninteraction.sendKeysToElement@chrome://remote/content/marionette/interaction.js:600:11\nsendKeysToElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:497:24\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:151:31\n"}}
__WD_Post ==> Element interaction issue (14) HTTP status = 400 : ResponseText={"value":{"error":"element not interactable","message":"Element <input class=\"gLFyf gsfi\" name=\"q...
_WD_ElementAction ==> Element interaction issue (14) HTTP status = 400 : {"value":{"error":"element not interactable","message":"Element <input class=\"gLFyf gsfi\" name=\"q\" type=\"text\"> is not reachable by keyboard","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nElementNotInteractableError@chrome://remote/content/shared/webdriver/Errors.jsm:293:5\nwebdriverSendKeysToElement@chrome://remote/content/marionette/interaction.js:624:13\ninteraction.sendKeysToElement@chrome://remote/content/marionette/interaction.js:600:11\nsendKeysToElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:497:24\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:151:31\n"}}
__WD_Post ==> Element interaction issue (14) HTTP status = 400 : ResponseText={"value":{"error":"element click intercepted","message":"Element <input class=\"gLFyf gsfi\" name=\"...
_WD_ElementAction ==> Element interaction issue (14) HTTP status = 400 : {"value":{"error":"element click intercepted","message":"Element <input class=\"gLFyf gsfi\" name=\"q\" type=\"text\"> is not clickable at point (480,398) because another element <li class=\"gowsYd GFzJLc\"> obscures it","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nElementClickInterceptedError@chrome://remote/content/shared/webdriver/Errors.jsm:282:5\nwebdriverClickElement@chrome://remote/content/marionette/interaction.js:166:11\ninteraction.clickElement@chrome://remote/content/marionette/interaction.js:125:11\nclickElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:203:24\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:91:31\n"}}
__WD_Post ==> Element interaction issue (14) HTTP status = 400 : ResponseText={"value":{"error":"element not interactable","message":"Element <input class=\"gNO89b\" name=\"btnK\...
_WD_ElementAction ==> Element interaction issue (14) HTTP status = 400 : {"value":{"error":"element not interactable","message":"Element <input class=\"gNO89b\" name=\"btnK\" type=\"submit\"> could not be scrolled into view","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nElementNotInteractableError@chrome://remote/content/shared/webdriver/Errors.jsm:293:5\nwebdriverClickElement@chrome://remote/content/marionette/interaction.js:156:11\ninteraction.clickElement@chrome://remote/content/marionette/interaction.js:125:11\nclickElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:203:24\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:91:31\n"}}
- wd_demo.au3: #389 : ERROR=0 $sValue = 
__WD_Post ==> No alert present (12) HTTP status = 404 : ResponseText={"value":{"error":"no such alert","message":"","stacktrace":"WebDriverError@chrome://remote/content/...
_WD_Alert ==> No alert present (12) HTTP status = 404 : {"value":{"error":"no such alert","message":"","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nNoSuchAlertError@chrome://remote/content/shared/webdriver/Errors.jsm:384:5\nGeckoDriver.prototype._checkIfAlertIsPresent@chrome://remote/content/marionette/driver.js:2575:11\nGeckoDriver.prototype.acceptDialog@chrome://remote/content/marionette/driver.js:2498:8\ndespatch@chrome://remote/content/marionette/server.js:306:40\nexecute@chrome://remote/content/marionette/server.js:279:16\nonPacket/<@chrome://remote/content/marionette/server.js:252:20\nonPacket@chrome://remote/content/marionette/server.js:253:9\n_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:500:20\n"}}
+ wd_demo.au3: Finished: DemoElements

image

mlipok avatar Apr 11 '22 18:04 mlipok

FIREFOX: DemoScript

+ wd_demo.au3: Running: DemoScript
- wd_demo.au3: #427 : ERROR=0 $sValue = 2nd _WD_LastHTTPResult = 200
__WD_Post ==> Webdriver Exception (10) HTTP status = 500 : ResponseText={"value":{"error":"javascript error","message":"ReferenceError: dslfkjsdklfj is not defined","stackt...
_WD_ExecuteScript ==> Webdriver Exception (10) HTTP status = 500 :  : Response={"value":{"error":"javascript error","message":"ReferenceError: dslfkjsdklfj is not defined","stackt...
- wd_demo.au3: #430 : ERROR=10 $sValue = {"value":{"error":"javascript error","message":"ReferenceError: dslfkjsdklfj is not defined","stacktrace":"@https://demo.guru99.com/test/simple_context_menu.html:2:7\n@https://demo.guru99.com/test/simple_context_menu.html:3:8\n"}} _WD_LastHTTPResult = 500
+ wd_demo.au3: Finished: DemoScript

image

mlipok avatar Apr 11 '22 18:04 mlipok

FIREFOX: DemoFrames

+ wd_demo.au3: Running: DemoFrames
- wd_demo.au3: #522 : Frames=3
- wd_demo.au3: #526 : TopWindow = True
- wd_demo.au3: #534 : TopWindow = False
__WD_Post ==> Element interaction issue (14) HTTP status = 400 : ResponseText={"value":{"error":"element click intercepted","message":"Element <a href=\"where_to_start.asp\"> is ...
_WD_ElementAction ==> Element interaction issue (14) HTTP status = 400 : {"value":{"error":"element click intercepted","message":"Element <a href=\"where_to_start.asp\"> is not clickable at point (141,100) because another element <h1> obscures it","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nElementClickInterceptedError@chrome://remote/content/shared/webdriver/Errors.jsm:282:5\nwebdriverClickElement@chrome://remote/content/marionette/interaction.js:166:11\ninteraction.clickElement@chrome://remote/content/marionette/interaction.js:125:11\nclickElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:203:24\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:91:31\n"}}
_WD_LinkClickByText ==> Webdriver Exception (10) HTTP status = 400
- wd_demo.au3: #545 : TopWindow = False
- wd_demo.au3: #550 : TopWindow = True
+ wd_demo.au3: Finished: DemoFrames

image

mlipok avatar Apr 11 '22 18:04 mlipok

FIREFOX: DemoDownload

+ wd_demo.au3: Running: DemoDownload
_WD_DownloadFile ==> Not found (13 / 0)
+ wd_demo.au3: Finished: DemoDownload

image

mlipok avatar Apr 11 '22 18:04 mlipok

Take a look on this errors. Are they intentionall or should be fixed ?

mlipok avatar Apr 11 '22 18:04 mlipok

I don't have time to redo all these tests. #267 resolved the open issues that I previously found. I ran DemoElements and didn't encounter any issues, so it appears to be a problem on your end.

+ wd_demo.au3: Running: DemoElements
@ wd_demo.au3: (350) : Element Coords = 397 / 381.5 / 527 / 34
@ wd_demo.au3: (389) : ERROR=0 $sValue = fujimo
+ wd_demo.au3: Finished: DemoElements

Danp2 avatar Apr 11 '22 23:04 Danp2

I ran DemoElements and didn't encounter any issues, so it appears to be a problem on your end.

Strange. I suspect that It should behave the same way on any computers. The only one what could differ is AV software and internet speed.

What else can be the reason that we have different results ? Do you have any idea ?

mlipok avatar Apr 12 '22 00:04 mlipok

Which branch are you using for testing? Does it include the latest fixes fro #267?

Danp2 avatar Apr 12 '22 01:04 Danp2

Does it include the latest fixes fro #267? Yes.

Currently I use this one: https://github.com/Danp2/au3WebDriver/pull/288

mlipok avatar Apr 12 '22 01:04 mlipok

That should be fine AFAICS. What combination of Firefox / Geckodriver are you using?

Danp2 avatar Apr 12 '22 01:04 Danp2

_WD_IsLatestRelease ==> Success (0) : True
_WD_Startup: OS:	WIN_11 WIN32_NT 22000 
_WD_Startup: AutoIt:	3.3.16.0
_WD_Startup: Webdriver UDF:	0.8.1 (Up to date)
_WD_Startup: WinHTTP:	1.6.4.2
_WD_Startup: Driver:	geckodriver.exe (32 Bit)
_WD_Startup: Params:	--log trace
_WD_Startup: Port:	4444
_WD_Startup: Command:	"geckodriver.exe" --log trace 

and

_WD_CreateSession: {"value":{"sessionId":"abb01461-0bdc-4f6d-8af3-5450a3c63270","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"96.0.2","moz:accessibilityChecks":false,"moz:buildID":"20220119190439","moz:geckodriverVersion":"0.30.0","moz:headless":false,"moz:processID":105324,"moz:profile":"C:\\Users\\agatk\\AppData\\Local\\Temp\\rust_mozprofilez176Nr","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"pageLoadStrategy":"normal","platformName":"windows","platformVersion":"10.0","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify"}}}

mlipok avatar Apr 12 '22 01:04 mlipok

_WD_Startup: Driver: geckodriver.exe (32 Bit)

Have you tried the 64 bit version? I know that I had issues with 32 bit, but it was related to locating the Firefox binary executable.

Not sure this would make any difference, but I see that your Firefox is several versions old. I'm testing with v99.0.

Danp2 avatar Apr 12 '22 02:04 Danp2

It was due to the cookie aprovall window which hides contents, and because of this the elements was firing Element interaction issue

mlipok avatar Apr 12 '22 15:04 mlipok

Ok... please let me know if you find any other issues that need fixed. 👍

Danp2 avatar Apr 12 '22 15:04 Danp2

It was due to the cookie aprovall window which hides contents, and because of this the elements was firing Element interaction issue

I have work in background on fixing this issue

mlipok avatar Apr 12 '22 15:04 mlipok

DemoElements + FireFox

	_WD_Alert($sSession, 'accept')

I get this following message:

__WD_Post ==> No alert present (12) HTTP status = 404 : ResponseText={"value":{"error":"no such alert","message":"","stacktrace":"WebDriverError@chrome://remote/content/...
_WD_Alert ==> No alert present (12) HTTP status = 404 : {"value":{"error":"no such alert","message":"","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nNoSuchAlertError@chrome://remote/content/shared/webdriver/Errors.jsm:384:5\nGeckoDriver.prototype._checkIfAlertIsPresent@chrome://remote/content/marionette/driver.js:2575:11\nGeckoDriver.prototype.acceptDialog@chrome://remote/content/marionette/driver.js:2498:8\ndespatch@chrome://remote/content/marionette/server.js:306:40\nexecute@chrome://remote/content/marionette/server.js:279:16\nonPacket/<@chrome://remote/content/marionette/server.js:252:20\nonPacket@chrome://remote/content/marionette/server.js:253:9\n_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:500:20\n"}}

mlipok avatar Apr 13 '22 21:04 mlipok

I cannot duplicate this. Here's the output I get when running DemoElements with logging set to Error only --

+>17:43:43 Starting AutoIt3Wrapper (21.316.1639.1) from:Code.exe (1.66.2.0)  Keyboard:00000409  OS:WIN_10/2009  CPU:X64 OS:X64  Environment(Language:0409)
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:c:\Users\danpo\OneDrive\Documents\GitHub\WebDriver\wd_demo.au3
+>17:43:44 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "c:\Users\danpo\OneDrive\Documents\GitHub\WebDriver\wd_demo.au3"  /errorstdout
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop.
> UpdateResult = False
_WD_CapabilitiesDump: _WD_Capabilities: API START: 799
_WD_CapabilitiesDump: - $_WD_CAPS__API: Rows= 1
_WD_CapabilitiesDump: - $_WD_CAPS__API: Cols= 5
$_WD_CAPS__API : alwaysMatch|||moz:firefoxOptions|
_WD_CapabilitiesDump: _WD_Capabilities: API END: 799
_WD_CapabilitiesDump: _WD_Capabilities: JSON START: 799
_WD_CapabilitiesDump: {
    "capabilities":{
        "alwaysMatch":{
            "browserName":"firefox",
            "acceptInsecureCerts":true
        }
    }
}
_WD_CapabilitiesDump: _WD_Capabilities: JSON END: 799
> wd_demo.au3: _WD_Startup
> wd_demo.au3: _WD_CreateSession
> wd_demo.au3: Bypass: DemoTimeouts
> wd_demo.au3: Bypass: DemoNavigation
+ wd_demo.au3: Running: DemoElements
__WD_Post ==> No match (8) HTTP status = 404 : ResponseText={"value":{"error":"no such element","message":"Unable to locate element: //body/div[1][@aria-hidden=...
_WD_FindElement ==> No match (8) HTTP status = 404 : {"value":{"error":"no such element","message":"Unable to locate element: //body/div[1][@aria-hidden=\"true\"]","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nNoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:395:5\nelement.find/</<@chrome://remote/content/marionette/element.js:300:16\n"}}
wd_demo.au3: (354) : Element Coords = 397 / 381.5 / 527 / 34
wd_demo.au3: (393) : ERROR=0 $sValue = fujimo
__WD_Post ==> No match (8) HTTP status = 404 : ResponseText={"value":{"error":"no such element","message":"Unable to locate element: //div[@id=\"gdpr-consent-to...
_WD_FindElement ==> No match (8) HTTP status = 404 : {"value":{"error":"no such element","message":"Unable to locate element: //div[@id=\"gdpr-consent-tool-wrapper\" and @aria-hidden=\"true\"]","stacktrace":"WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5\nNoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:395:5\nelement.find/</<@chrome://remote/content/marionette/element.js:300:16\n"}}
+ wd_demo.au3: Finished: DemoElements
> wd_demo.au3: Bypass: DemoScript
> wd_demo.au3: Bypass: DemoCookies
> wd_demo.au3: Bypass: DemoAlerts
> wd_demo.au3: Bypass: DemoFrames
> wd_demo.au3: Bypass: DemoActions
> wd_demo.au3: Bypass: DemoDownload
> wd_demo.au3: Bypass: DemoWindows
> wd_demo.au3: Bypass: DemoUpload
> wd_demo.au3: Bypass: DemoPrint
> wd_demo.au3: Bypass: DemoSleep
+>17:44:44 AutoIt3.exe ended.rc:0
+>17:44:44 AutoIt3Wrapper Finished.
Process exited with code 0

The only errors I see here are from your failed _wd_FindElement calls trying to deal with cookies.

You need to try to isolate this problem with your Firefox installation.

Danp2 avatar Apr 13 '22 22:04 Danp2

In DemoScript() this line:

$sValue = _WD_ExecuteScript($sSession, "dslfkjsdklfj;", '{}', Default, $_WD_JSON_Value)

returns:

ResponseText={"value":{"error":"javascript error","message":"ReferenceError: dslfkjsdklfj is not defined","stacktrace":"@moz-nullprincipal:{0441953c-25eb-496d-8a5c-c8db36606135}:2:7\n@moz-nullprincipal:{0441953c-25eb-496d-8a5c-c8db36606135}:3:8\n"}}

Was it intentionall to initiate error ?

mlipok avatar Apr 15 '22 22:04 mlipok

Was it intentionall to initiate error ?

Yes, but feel free to replace with something more meaningful.

Danp2 avatar Apr 16 '22 00:04 Danp2

What was the intention?

mlipok avatar Apr 19 '22 19:04 mlipok

Simply to show the effect of generating a javascript error, so it isn't really needed if you want to remove it or replace it with something more meaningful

Danp2 avatar Apr 19 '22 22:04 Danp2