Different object names according to different browsers

Hello,

When I run the Web Recorder with IE on the login page of a site, Katalon creates the “input_username” and “input-password” objects for the login and password entry fields.

When I start Wed Recorder with Chrome or Firefox on the same page, Katalon creates the objects "input_ (required) _username" and “input_ (required) _password”.

As I have to make test scripts that can be launched on these 3 browsers, I am very annoyed.
How to solve my problem?

Thanks for your help

Hi,
The name of the object is not important.
Try to run the test case recorded on IE with Chrome or Firefox, it should work

Thansk HeleneB

I created a test case by embedding with IE. It created an “input_username” object.
When I run the test under IE I have the error:
Test Cases/New Test Case FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘11324589’ of object 'Object Repository/Page_Connexion/input_username’

When I run this test case under Chrome, it works

I don’t understand

Please, share the full log error

Okay
The full log :

Test Cases/New Test Case FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘11324589’ of object ‘Object Repository/Page_Connexion/input_username’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:66)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$1.call(Unknown Source)
at New Test Case.run(New Test Case:20)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1565258193207.run(TempTestCase1565258193207.groovy:21)
Caused by: org.openqa.selenium.NoSuchWindowException: Unable to find elements on closed window
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DV01VWQATS01’, ip: ‘172.16.96.216’, os.name: ‘Windows Server 2016’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
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:25854/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true}
Session ID: f4425986-627f-4bcd-8a39-4d99601d7237
*** Element info: {Using=xpath, value=//input[@name = ‘username’ and @title = ‘Identifiant’ and @id = ‘username’ and @type = ‘text’ and @placeholder = ‘Identifiant’]}
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:552)
at com.kms.katalon.selenium.driver.CInternetExplorerDriver.execute(CInternetExplorerDriver.java:22)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:432)
at org.openqa.selenium.By$ByXPath.findElements(By.java:348)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:311)
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElements(WebUiCommonHelper.java:761)
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1093)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.doCall(SetTextKeyword.groovy:51)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.call(SetTextKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 17 more

It could be a configuration problem. Have you followed all required configurations from this page ?

1 Like

Can you share the HTML for the object you try to set text on Chrome and IE ?

@HeleneB : yes I configured IE as shown

The HTML the 2 objects
fields: {
username: {
validators: {
notEmpty: {
message: ‘Le code utilisateur est requis’
}
}
},
password: {
validators: {
notEmpty: {
message: ‘Le mot de passe est requis’
}
}
}

	}
Identifiant (requis)
Mot de passe (requis)

Can you send a picture of both Html source code, it would help us help you :slight_smile:

HTML.txt (9.6 KB)

Try using this as your object XPath for username : //[@id=“username”]
and this for password : //
[@id=“password”]

I recreated the test case with IE. Launching the test case with IE it does not work
It works with Chrome and Firefox
The created object does not contain anything in XPath.

I add [@ id = “username”] in XPath => it does not work for any browser
I add // input [@ id = ‘username’] in XPath => Chrome + Firefox OK and IE KO with the same error

From the beginning, it’s not an Xpath problem, but an IE problem.

By searching the forum, some people disabled the “Enable Protected Mode” on IE for all zones, can you try ?

j’avais vu sur le forum les posts concernant ignoreProtectedModeSettings.
Je l’ai déjà configuré et ca ne marche

(Il faut écrire en anglais ici :wink: )
So I can’t help you any more, I can’t reproduce the error even without a full configuration

To do several things at the same time, I am confused

I wanted to say :
I have seen posts on ignoreProtectedModeSettings on the forum.
I already configured it and it does not work