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

Geb not pointing to right page after closing confirm dialog in new window #568

Closed
schintha1 opened this issue Mar 15, 2019 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@schintha1
Copy link

@schintha1 schintha1 commented Mar 15, 2019

Please avoid submitting usage questions as issues and use the user mailing list at https://groups.google.com/forum/#!forum/geb-user instead.
I am doing test automation with geb in groovy, curently dealing with scenario like: First, I am in parent window, from there I open new window and do some search there, Clicking on the search result generates a confirm dialogue and updates the value in parent page, Bypassing the dialog with withConfirm(). then I come to parent window but nothing executes after that. I think geb is getting confused between pages.

In parent Page
open new window
search for something
click on the first search result
clicking on it opens a confirm dialog
click okay and close the new window
continue with parent window

My code looks like:

withNewWindow({$("button",id:'btn_account_name').click()},wait:true,close:false) {
		sleep(3000)
		waitFor{
		
			title == "Spartan CRM"
		}
		assert withConfirm(true){$("tr.oddListRowS1:first-child a",0).click()}.text().contains("This record")
		}
	$("input[name='button'][id='SAVE_FOOTER']").click()

Error:

Caught: org.openqa.selenium.NoSuchWindowException: Browsing context has been discarded
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'DESKTOP-NAFK3F3', ip: '10.0.0.43', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 65.0.2, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.24.0, moz:headless: false, moz:processID: 4264, moz:profile: C:\Users\Dell\AppData\Local..., moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10.0, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 4b4e6bb5-e778-429d-b265-c29129a825a1
org.openqa.selenium.NoSuchWindowException: Browsing context has been discarded
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'DESKTOP-NAFK3F3', ip: '10.0.0.43', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 65.0.2, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.24.0, moz:headless: false, moz:processID: 4264, moz:profile: C:\Users\Dell\AppData\Local..., moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10.0, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 4b4e6bb5-e778-429d-b265-c29129a825a1
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
	at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:485)
	at geb.js.JavascriptInterface.execjs(JavascriptInterface.groovy:66)
	at geb.js.JavascriptInterface.exec(JavascriptInterface.groovy:56)
	at geb.js.DefaultAlertAndConfirmSupport.popLastDialogFunctionOnto(DefaultAlertAndConfirmSupport.groovy:114)
	at geb.js.DefaultAlertAndConfirmSupport.captureDialog(DefaultAlertAndConfirmSupport.groovy:168)
	at geb.js.DefaultAlertAndConfirmSupport.captureConfirm(DefaultAlertAndConfirmSupport.groovy:182)
	at geb.js.DefaultAlertAndConfirmSupport.withConfirm(DefaultAlertAndConfirmSupport.groovy:54)
	at geb.js.AlertAndConfirmSupport$withConfirm$0.callCurrent(Unknown Source)
	at geb.js.DefaultAlertAndConfirmSupport.withConfirm(DefaultAlertAndConfirmSupport.groovy:50)
	at geb.js.AlertAndConfirmSupport$withConfirm.call(Unknown Source)
	at geb.Page.withConfirm(Page.groovy:130)
	at geb.Browser.methodMissing(Browser.groovy:249)
	at geb.Browser.invokeMethod(Browser.groovy)
	at CRMPageExample$_run_closure1$_closure3.doCall(CRMPageExample.groovy:149)
	at CRMPageExample$_run_closure1$_closure3.doCall(CRMPageExample.groovy)
	at geb.Browser.withNewWindow(Browser.groovy:798)
	at CRMPageExample$_run_closure1.doCall(CRMPageExample.groovy:135)
	at CRMPageExample$_run_closure1.doCall(CRMPageExample.groovy)
	at geb.Browser.drive(Browser.groovy:128)
	at geb.Browser$drive$0.callStatic(Unknown Source)
	at geb.Browser.drive(Browser.groovy:98)
	at geb.Browser$drive.call(Unknown Source)
	at CRMPageExample.run(CRMPageExample.groovy:97)
1552669185711	Marionette	INFO	Stopped listening on port 58327
[Parent 4264, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 6032, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 6032, Chrome_ChildThread] WARNING: pipe error: 1[Child 11296, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 11296, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Parent 4264, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 4772, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 4772, Chrome_ChildThread] WARNING
###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

[GPU 14400, Chrome_ChildThread] WARNING: pipe error: 109: fi
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv

Methods I tried but seems useless:

waitFor{
        withwindow{Parent window}){true}

    }

Thanks in advance

@erdi erdi self-assigned this Oct 19, 2019
@erdi erdi added the Bug label Oct 19, 2019
@erdi erdi added this to the 3.2 milestone Oct 19, 2019
@erdi erdi closed this in c8a1db6 Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants