Unable to find elements on closed window error

Hi there,
I am executing my first Automated test case and am getting this error. Can someone please help…
Error: Unable to set text’dev\scms.user17’ of object ‘Object repository/Page sign In/input UserName’ (Root cause: org.openqa.selenium.NoSuchWindowException: Unable to find elements on closed window)

Thanks,
Mahesh

1 Like

would you show me your script?

Yes, here it is -
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘DESKTOP-40IGFF8’, ip: ‘10.148.180.148’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CInternetExplorerDriver

Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:4618/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true}

Session ID: c64f6ada-02c3-4e68-bd38-91178c6fd203

*** Element info: {Using=xpath, value=//input[@name = ‘UserName’ and @id = ‘userNameInput’ and @type = ‘email’ and @placeholder = ‘someone@example.com’]})

03-20-2018 02:10:15 PM - [END] - End action : setText

03-20-2018 02:10:15 PM - [FAILED] - Test Cases/Sign On FAILED because (of) Unable to set text ‘dev\scms.user17’ of object ‘Object Repository/Page_Sign In/input_UserName’ (Root cause: org.openqa.selenium.NoSuchWindowException: Unable to find elements on closed window

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘DESKTOP-40IGFF8’, ip: ‘10.148.180.148’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_102’

Driver info: com.kms.katalon.selenium.driver.CInternetExplorerDriver

Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:4618/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true}

Session ID: c64f6ada-02c3-4e68-bd38-91178c6fd203

*** Element info: {Using=xpath, value=//input[@name = ‘UserName’ and @id = ‘userNameInput’ and @type = ‘email’ and @placeholder = ‘someone@example.com’]})

03-20-2018 02:10:15 PM - [END] - End Test Case : Test Cases/Sign On

I mean… and copy the text.

Captura.PNG

Sorry, did you mean this -

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://sts-sejs.dev.global.gc.ca/adfs/ls/?wa=wsignin1.0&wtrealm=https%3A%2F%2Ftest1-hc-cdt.dev.global.gc.ca%2F&wctx=rm%3D1%26id%3D622358f3-cfb4-4d98-b82e-ad6c76ae49ed%26ru%3Dhttps%3a%2f%2ftest1-hc-cdt.dev.global.gc.ca%2fmain.aspx%26crmorgid%3D74279eca-81d3-e711-8107-005056817939&wct=2018-03-20T16%3A52%3A34Z&wauth=urn%3Aoasis%3Anames%3Atc%3ASAML%3A1.0%3Aam%3Apassword#716397291’)

WebUI.setText(findTestObject(‘Page_Sign In/input_UserName’), ‘dev\\scms.user17’)

WebUI.setText(findTestObject(‘Page_Sign In/input_Password’), ‘Password1’)

WebUI.click(findTestObject(‘Page_Sign In/span_Sign in’))

WebUI.closeBrowser()

ok, the script looks ok, but I think that the problem is in the “Object Repository” cause katalon cant find your object, try this go to the “Object Repository” and dobleclick on the object input_UserName and if the object has a “id” uncheck the others attributes.
some attributes are dynamic and is better if you dont use it to find your objects.

Captura123.PNG

I tried it, doesn’t seem to work. The page opens up but there is no entry in the Username and Password fields. the same error is shown in the Log viewer

ok, try to add to your script this
WebUI.waitForPageLoad(20)

like this:

WebUI.openBrowser(’’)

WebUI.navigateToUrl('https://sts-sejs.dev.global.gc.ca/adfs/ls/?wa=wsignin1.0&wtrealm=https://test1-hc-cdt.dev.global.gc.ca/&wctx=rm=1&id=622358f3-cfb4-4d98-b82e-ad6c76ae49ed&ru=https%3a%2f%2ftest1-hc-cdt.dev.global.gc.ca%2fmain.aspx&crmorgid=74279eca-81d3-e711-8107-005056817939&wct=2018-03-20T16:52:34Z&wauth=urn:oasis:names:tc:SAML:1.0:am:password#716397291’)

WebUI.waitForPageLoad(20)

WebUI.setText(findTestObject(‘Page_Sign In/input_UserName’), ‘dev\\scms.user17’)

WebUI.setText(findTestObject(‘Page_Sign In/input_Password’), ‘Password1’)

WebUI.click(findTestObject(‘Page_Sign In/span_Sign in’))

WebUI.closeBrowser()

I tried that and still the same. Also, I noticed that in my input for the username [dev\scms.user17] I have just one back slash but in the script it is showing two back slashes and if I delete one, it shows a bug. So, I just ran it after adding the WebUI.waitForPageLoad(20) and there’s no change.

are you using Internet Explorer?
could you try it in other browser.

Sorry for the delayed response, I was having some browser compatibitlity issues.
Yes, I tried it on Chrome and it works. Thanks for all your help.

no problem :slight_smile:

Hi - I have same issue as Mahesh - getting ‘NoSuchWindowException’ exception in IE11.
Seems to be consistent across the few testers here that use Katalon.
Would be very grateful for assistance - my problem is that app users (clients) use IE11, so Chrome would not be an ideal workaround for us.

I have updated the registry in line with config instructions and use latest version of Katalon.
I also tried setting ‘ignoreProtectedModeSettings’ to ‘True’ - as company policy has hidden the ‘security’ tab in IE.

Same problem overhere. Script runs fine in Chrome. In IE: Unable to find elements on closed window.
I added a 'Verify element present. Element is not found in this step and item in script crashes with the above error.

Edge is another story. Verify Element Present is oke. Click on the button gives ‘Element is obscured’.

Is this a known issue with Katalon, with IE11 ?

1 Like

Will they fix this issue in IE11??

yes, it’s a bug to me.
have also tried all the tricks, but still see same issue in IE11 with katalon 5.5

Hi there! Anyone from Katalon Team please confirm this bug or suggest any working way (script) to resolve situation. Thanks in advance!

Guys, I’ve figuredout: refer to this link https://docs.katalon.com/display/KD/Internet+Explorer+Configurations
So the main thing for me was to unselect (disable) the “Enable Protected Mode” checkmark (and also do this action at the Advanced tab of the Internet Options - if it is enabled). But pay attention - you must unselect (disable) the “Enable Protected Mode” checkmark FOR ALL ZONES which means to uncheck it for “Internet”. “Local intranet”, “Trusted sites” & “Restricted sites” - then click Apply and restart IE browser.

2 Likes