Unable to set text during playback of recorded session. Bug?

I recorded a session with one of our web applications, using Chrome. During playback, a failure was encountered while attempting to populate a text box. Screen shots of the Katalon session and the web page it was manipulating are attached.

We commonly link radio buttons to a text box used to enter database search criteria, allowing the user to specify whether to search for values that either Starts With or Contains the entered value. As you can see from the webpage screen shot, the Supplier Number radio button is set to Starts With, but the Katalon playback session is mistakenly using the object input_Contains_supplier_number_search_text_id when the set text operation fails.

This appears to me to be a bug. Please advise.

Application webpage image during “set text” failure:

Katalon playback session image:

Hi Kirk

It would help a lot if you could share the underlying HTML and the definition for your Test Objects.

In the meantime, I’ll take a guess as to what is happening.

  1. User clicks a radio.
  2. User enters a value in the associated text box.

Somewhere between #1 and #2 the text box is either modified or replaced to reflect the chosen radio.

When you automate the above scenario, #2 happens so fast, the page has not had time to make the change from one type of text box to the other.

1 Like

Thanks, Russ.

I believe your guess is incorrect. The radio button was not altered during the recorded session. “Starts With” is the default. “Contains” is the object Katalon was inexplicably using.

Do you want the HTML from the page immediately before or immediately after the failure? (It’s late here now; I will provide that tomorrow.)

Not sure what you mean by “definition for your Test Objects”. Is the Katalon screen shot insufficient?

Cheers.

Kirk

@russ_thomas means, that you should provide information - how the related html object - which is stored in the section “object repository” is defined.

Is it xpath, attributes or css?

And how does the config look like.

So the recording session had produced the wrong output in the Manual View you posted in the screenshot?

I believe that’s correct, Russ. Here’s the script view of the recorded session, with the line in question highlighted. Note that the variable is input_Contains_supplier_number_search_text_id, when I would have been expected input_Starts_With_supplier_number_search_text_id.

Here’s the html source immediately following failure. Please search for “supplier_number_search” for relevant lines.

source_html.txt (52.8 KB)

Thanks for your input @masdesign. Katalon is totally new to me. I’m familiarizing myself with it for evaluation purposes. I have minimal Katalon domain knowledge.

There are no related objects in “Object Repository”. I am simply replaying the activity I recorded, and captured as a “Test Case”.

Well that is concerning. If you recorded a session, the recording tool should have built Test Objects in the Object Repository. And if it didn’t and you didn’t write the script by hand, how did Katalon produce it?

It’s the definition of each Test Object that interests me. If you recorded them, they are likely to be using xpaths and/or css to locate the HTML elements on the page when the test is executing.

What we’re trying to establish is: Did the recorder screw up? Did it create bad xpaths? If so, how come this failed for you (IOW, how come we’re not inundated with users complaining it’s badly broken)?

So that’s where we are. Post a screenshot of the OR showing the definitions for the element it SHOULD be using and the element it’s ACTUALLY using. The Test Object IDs are the references you can see in your highlighted line in your previous screenshot. Essentially, the content of findTestObject(…)

Being pragmatic for a moment: we could just edit the script in Script View and move on with our lives… but then we don’t learn anything :nerd_face:

Sorry, forgot to mention…

Your HTML does not contain input_Contains*. Leads me to suggest the same as before… this is a timing issue of some kind.

That doesn’t explain why the recorder produced this “as is”… but one step at a time.

When you post back, add a copy of the HTML before the test runs.

In Object Repository folder on the left side, navigate into the subdirectory as you see it in the findObject statement you highlighed blue. then double-click the object input-contains-supplier-number-search-id)

After that, provide a screenshot of what is displayed in your Katalon.