Chrome Issue

354 views
Skip to first unread message

raz

unread,
Aug 24, 2020, 5:20:59 PM8/24/20
to Geb User Mailing List
I have this Salesforce lightning site which is working fine with Firefox but when I run the same test in Chrome, it's like it can't ready anything from DOM and just waits at the first instruction.

For example, when a page loads, I have this code to ensure its loaded before interacting with the objects which works flawlessly on Firefox and in Edge.

waitFor(WAIT_TIME) { browser.$('h2', text: contains('Eligibility Check')).isDisplayed() }

but the same line of code throws geb.waiting.WaitTimeoutException: condition did not pass in 30 seconds when I run the test in Chrome and I can see the page is loaded but seems like Geb/Selenium can't interact with the DOM hence the exception.

Any ideas what may be going on? I've tried various machines, versions of Chrome but can;t seem to figure it out. Any help is greatly appreciated.

Marcin Erdmann

unread,
Aug 25, 2020, 12:43:51 PM8/25/20
to geb-...@googlegroups.com
What's the stacktrace of the exception?

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/e9c3cc81-156c-45e0-a3bb-ebb6f888d76bn%40googlegroups.com.

raza

unread,
Aug 25, 2020, 7:33:33 PM8/25/20
to geb-...@googlegroups.com
geb.waiting.WaitTimeoutException: condition did not pass in 30 seconds
        at geb.waiting.Wait.waitFor(Wait.groovy:124)
        at geb.waiting.Wait$waitFor.call(Unknown Source)
        at geb.waiting.DefaultWaitingSupport.doWaitFor(DefaultWaitingSupport.groovy:50)
        at geb.waiting.DefaultWaitingSupport.waitFor(DefaultWaitingSupport.groovy:41)
        at geb.waiting.DefaultWaitingSupport.waitFor(DefaultWaitingSupport.groovy)
        at geb.waiting.WaitingSupport$waitFor.call(Unknown Source)
        at geb.Page.waitFor(Page.groovy:116)
        at geb.binding.BindingUpdater$InvocationForwarding.doCall(BindingUpdater.groovy:136)
        at step_definitions.Script4$_run_closure9.doCall(Script4.groovy:283)
        at ✽.I complete Eligibility Check(classpath:/home/TestAutomation/target/test-classes/features/Care.feature:9)

You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/IGedAOfoFNk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CA%2B52dQS6WXtTRg2cf-0RAYjX5mqPKopK-Ad7wPwQexu5O3BuhA%40mail.gmail.com.

Marcin Erdmann

unread,
Aug 26, 2020, 4:39:42 AM8/26/20
to geb-...@googlegroups.com
Is this the whole stacktrace? There usually would be a "caused by" section below this showing power assertion output of evaluation of the condition within the closure passed to waitFor which I'm after....

raza

unread,
Aug 26, 2020, 5:06:56 AM8/26/20
to geb-...@googlegroups.com
Unfortunately i could not find anything for 'caused by' section but have attached the whole output with maven -X switch 

Not sure if it's of help but when the script is running and Chrome is open, this gets written to the console (which I believe is not captured in the log for some reason)

[AsyncHttpClient-3-1] DEBUG org.asynchttpclient.netty.channel.ChannelManager - Adding key: http://localhost:11624 for channel [id: 0x320545e6, L:/127.0.0.1:59248 - R:localhost/127.0.0.1:11624]
[AsyncHttpClient-timer-1-1] DEBUG org.asynchttpclient.netty.channel.DefaultChannelPool - Entry count for : http://localhost:45231 : 1
[AsyncHttpClient-timer-1-1] DEBUG org.asynchttpclient.netty.channel.DefaultChannelPool - Entry count for : http://localhost:11624 : 1
[Forwarding findElements on session b41a30c970c711a4a91f4b11f2f56284 to remote] DEBUG org.asynchttpclient.netty.request.NettyRequestSender - Using pooled Channel '[id: 0x320545e6, L:/127.0.0.1:59248 - R:localhost/127.0.0.1:11624]' for 'POST' to 'http://localhost:11624/session/b41a30c970c711a4a91f4b11f2f56284/elements'
[Forwarding findElements on session b41a30c970c711a4a91f4b11f2f56284 to remote] DEBUG org.asynchttpclient.netty.request.NettyRequestSender - Using open Channel [id: 0x320545e6, L:/127.0.0.1:59248 - R:localhost/127.0.0.1:11624] for POST '/session/b41a30c970c711a4a91f4b11f2f56284/elements'
[AsyncHttpClient-3-1] DEBUG org.asynchttpclient.netty.handler.HttpHandler -

Request DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
POST /session/b41a30c970c711a4a91f4b11f2f56284/elements HTTP/1.1
User-Agent: selenium/4.0.0-alpha-5 (java unix)
Content-Length: 46
Content-Type: application/json; charset=utf-8
host: localhost:11624
accept: */*

Response DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Length: 12
Content-Type: application/json; charset=utf-8
cache-control: no-cache

out.txt

raza

unread,
Aug 28, 2020, 8:40:15 PM8/28/20
to geb-...@googlegroups.com
Was that information of any help? If you can direct me on how to debug further, I can do it! Thanks

raz

unread,
Aug 31, 2020, 1:12:12 AM8/31/20
to Geb User Mailing List
In order to further troubleshoot the issue, I added a static wait to ensure page loads completely before doing any checks and after it loaded, I tried to enter a value in a field.

Tried the following:

browser.$('lightning-input', 'data-field': 'firstName').find('input').value('TESTER')
and
browser.$('#input-14').value("TESETR")

It didn't throw any exception or error but didn't enter anything in the field either. Same code works in Firefox (as in enters the value in the field)

Console output is as follows:

[io.cucumber.core.cli.Main.main()] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 84.0.4147.30 (since Google Chrome 84 is installed in your machine)
[io.cucumber.core.cli.Main.main()] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\xxx\.m2\repository\webdriver\chromedriver\win32\84.0.4147.30\chromedriver.exe
Starting ChromeDriver 84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310}) on port 35148
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1598849466.615][WARNING]: This version of ChromeDriver has not been tested with Chrome version 85.
Aug 31, 2020 2:51:08 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C

I've added a couple of snapshots of DOM as well.

Later I added a line of code below to switch to sibling iFrame thinking it could be the causing some overlay issues 

browser.driver.switchTo().frame("recaptcha_iframe-5")

that threw this exception

org.openqa.selenium.NoSuchFrameException: No frame element found by name or id recaptcha_iframe-5
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-SKVDL2C', ip: '192.168.10.10', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame(RemoteWebDriver.java:885)
        at org.openqa.selenium.WebDriver$TargetLocator$frame.call(Unknown Source)
        at step_definitions.Script3$_run_closure1.doCall(Script3.groovy:25)
        at ?.I sign up(classpath:/C:/git/testautomationsandbox/target/test-classes/features/Care.feature:9)

That same line of code to switch frame did NOT throw any exception in Firefox.

Can someone please help???
DOM2.JPG
DOM.JPG
Reply all
Reply to author
Forward
0 new messages