Test case is passing in my local, when I run on docker Its failing

If I run the test Case in Katalon studio it pass. When I run it in gitlab ci/cd it fail.
Why in docker the object is not recognized ?
Solution ?

Docker does nothing relevant to your problem.

Which type of browser do you use?

I suppose you use Headed browser on desktop; Headless browser on server.

Headed browser, Headless browser — these are not the same. Sometimes they behave differently. Sometimes timing issues arise. Make sure if your test script is defensive enough for timing.

Also, Katalon Studio GUI and Katalon Runtime Engine — these are different software. Broadly speaking, KS runs slow, KRE runs fast. Why? KS performs very verbose logging and displaying messages to GUI. On the other hand KRE has no heavy weighted GUI, so KRE is fly weighted.

When your script does any click action which causes some status change in the page DOM (e.g, moving from URL a to URL b), your script must wait long enough until the action completely finishes before your script proceeds to next steps.

You attached your test case script. As far as I see, your code is not defensive enough.

I used Chrome. I know the difference but I do the same action of the previous object. I don’t understand why with previous object everything is fine

What is it?

…

Anyway,

Neither do I.

Your careful eye only can answer to it.

image

If DOM changed the error should be " StaleElementReferenceException : stale element reference : element is not attached to the page document

" When your script does any click action which causes some status change in the page DOM"

Marco, try increasing the delay to something ridiculous: WebUi.delay(3) ==> WebUI.delay(15)

If it works, you know for sure it’s a timing issue.

If the DOM changed unexpectedly, I think, you can not predict what sort of error will occur. All you could do is to write your code defensive enough.

increased delay. does not work :frowning:
what you suggest to fix it ?

I have a small doubt.

In the error message I noticed 2 strings

` Profamily spa`

and

`Profamily spa `

Please note a white space is on the left, and on the right.

The difference of a single white space is significant enough for XPath semantics. The above 2 strings are not equal, of course.

1 Like

Fixed with some workaround (using Robot) .
thanks to all