Placeholder locator not working: object not found


I have a web that contains generated ids and slightly changes the pages structure each time that we deploy, if common components are changed (webpack). As a solution to keep stable the Katalon scripts, and after reading this article:

I decided to change the locators in the objects, so instead of the normal xpath, now I base the search in the placeholder text like this:

//input[@placeholder=‘Search for a Client’]

But…it doesn’t work. The out of the box locator, works:


The selection method I used in both cases is “XPath”

Where did I go wrong?

Any help is welcome.

Can you share the html of the element ?

1 Like

Hi HeleneB,

This Is the bit of html where the element is contained:

<div class="jss717" style="transform: translate(0px, 0px); transition: transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms;">
	<p class="jss46 jss55 jss721">Search for possible duplicate :</p>
	<div class="jss722">No client with exact same name </div>
	<div class="jss718">
			<div role="combobox" aria-haspopup="listbox" aria-owns="react-autowhatever-1" aria-expanded="false" class="jss239">
					<div class="jss82 jss245" aria-autocomplete="list" aria-controls="react-autowhatever-1" maxlength="140">
						<label class="jss384 jss389 jss377 jss373 jss378 jss381" data-shrink="false">Client<span class="jss390">&thinsp;*</span>
						<div class="jss117 jss104 jss108 jss118 jss105" maxlength="140">
							<input aria-invalid="false" autocomplete="off" class="jss127 jss112" **placeholder="Search for a Client"** required="" type="text" value="">
					<div class="jss17 jss21" id="react-autowhatever-1" role="listbox"/>
		<div class="jss724"/>

It’s seems correct.
What is the exact error and context ?

1 Like

it says:

com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘myclient’ of object ‘Object Repository/Page_20/input__jss128 jss113’
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$ Source)
at create new new client:38)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
at com.kms.katalon.core.main.TestCaseExecutor.runScript(
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
at com.kms.katalon.core.main.TestCaseExecutor.execute(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable

I am certain the reason is that I am not landing at the same place when I use /input and when I use the placeholder, but I cannot understand how is it possible.

So, it’s not “object not found” !

I don’t think so. The element is still the same, but found differently.

Do you have a step waitForElement[Clickable, Visible or Present] before the send text ? If not, try to add them

1 Like

Yes, even, a delay. I tried everything…
I think there is a limitation here; I am going to provide more details on how the application works, just in case.
Before clicking in the field, there is a label (Client). the placeholder text is hidden until you click on the input.
If you I use the normal xpath, it works fine all the time. If I use the locator, the element is not interactable.

Any ideas?

After searching a bit, some people say that it could be that the issue could come from 2 elements sharing the same placeholder (not my case) and very few people say that the issue is the xpath is too vague, needing a bit more detail. So I check where could I get more detail from my page, knowing that everything is generic and generated, but I found something:

//div[@role=‘dialog’]//input[@placeholder=‘Search for a Client’]

And Thanks God, it did work.

1 Like