Element not interactable for a button to click

Once you say that is working, I will clean up this thread to avoid confusing future readers…

Thanks. Testing it now

No it did not work too.
For the “Valider” i did not get any error but it did not work as well as the action it was supposed to do did not happen:

And for the “Enregistrer” i got the same error as before:

@Russ_Thomas

Show me Valider when you run the selector in the console.

Enregistrer looks like you forgot the parens () >>> click()

For “Enregistrer” this is the code:

Is it not ok?
For “Valider” It showed undefined then when i pressed enter it clicked on the button.

One thing at a time.

Enregistrer - try this in the console:

document.querySelector('#twittcompta-creditnote-sentat-modal input[type=submit]')

Show me what it says. (Screenshot)

Then try this:

document.querySelector('#twittcompta-creditnote-sentat-modal input[type=submit]').click()

Show me what it says.

For Enregistrer:

document.querySelector(‘#twittcompta-creditnote-sentat-modal input[type=submit]’).click() - For this one it shows undefined and when then i think it sort of click on the button and the undefined disappears.

Is there a difference between docker and the UI. It works on UI but not on docker.

So Enrestrer is correct and working. When you run it in the test MAKE SURE the element is READY (try waiting for it).

Undefined is correct (Javascript shows you the result of running the click() method - it returns “nothing” which in JavaScript is “undefined”)

So the same is true of Valider. I think your code is now correct you just need to make sure the elements are ready before you click them.

Thanks @Russ_Thomas , since we are using the JS how will i make sure that the element is ready as in if i use
WebUI.waitForElementVisible(js,10) will it be ok in terms of syntax?

I dont want to use webUI.delay().

Wait for it to be visible (maybe clickable, too) and then run the JS.

Hi @Russ_Thomas i am getting the impression now that executeJavacript does not work in katalon docker:

I have tried to add delays it is not throwing any error in the console but nothing is actually working[ the action it is suppose to do in the site is not happening].
Have tried to used wait but cannot seem to get the syntax correct.

Is there a log or something i can add to verify what is happening when the script is running at this part.?

The same works properly when running in katalon UI.
Thank you a lot for your help.

I doubt that is true. Your code does not “run in docker” as such.

This guy might know more… @anon46315158

1 Like

@Russ_Thomas i was about to say you will ping me :slight_smile:

I will take a deep look those days as my free time afford it
Hidden may be the path of docker

I reviewed the discussion.
I see no reason for javascript to not execute in docker unless the element you try to manipulate is not rendered or visible.
This can occur due to the browser/display size.
Note that when you are running in docker with default parametters you get a maximum display size of 1024x768 with 24 bits color depht.

Please grab a screenshot using the dedicated keyword before to do the JS voodoo and upload it here unmodified (you can paint over it if you need to censor sensitive data but do not rescale/crop. We want to see the exact screen size allocated by xvfb)

Hi @anon46315158 and @Russ_Thomas i have sent you the info by DM. Thanks

@anuradha saw it.
at this moment i still bet on the browser size being the cause.
try to set a larger display size through the xvfb parameters and maximize the browser before to navigate to the url.