Test suite which works in katalon studio locally, fails when run on jenkins inside a katalon container

Hi,

We have a test suite which is running fine on the developer machine using katalon studio.
We’re trying to automate this using Jenkins and Katalon docker image. It’s failing with the error below.

Attached is the Jenkins console output. Please help us resolve this issue.

katalon_job_output.txt (280.5 KB)

Best Regards,
Sreevamsi

Hello,
by reading log it seems you cannot reach application from docker running on jenkins.
Try to check connection, from jenkins and from docker (correct proxy settings).
a bit complicated solution is to use selenium grid during development and excution from CI/CD pipeline - this way it will be consistent.

Hi @Andrej_Podhajsky
Connection seems to be fine but we are still facing the same issue

@helpdesk, @ThanhTo @duyluong @Chris_Trevarthen
Could you please look into this issue and suggest

Hi @sreevamsi.yandrapu,

I agree with @Andrej_Podhajsky that the docker could not connect to your url. You can put this command before navigateToUrl to verity the page source after navigating:

import com.kms.katalon.core.webui.driver.DriverFactory

WebUI.navigateToUrl(url)
println DriverFactory.getWebDriver().getPageSource()

Hi Duylong,

There seems to be no issue with the network as the telnet to the resolved ip and port is working. My testing team tried the code above and they’re still facing the same issue.

did you connect from telnet on docker on jenkins?

Hi Andrej_Podhasjky,

Yes I did a ’ docker run -it katalonpctv bash’ to login to the container and ran telnet. It’s getting connected. Also, I used tcpdump on the machine running docker and saw back and forth traffic from the src and dest.

Best Regards,
Sreevamsi

1 Like

@Andrej_Podhajsky

@sreevamsi.yandrapu

import com.kms.katalon.core.webui.driver.DriverFactory

WebUI.navigateToUrl(url)
println DriverFactory.getWebDriver().getPageSource()

Please share the execution log after you apply this code

what is the app url you are trying to reach? (if it is not a secret)
the application is hosted in a private/vpn network or it is an internet application?
can you log in to the container, as you did before, and try to grab the url using curl or wget ?
chances are … you may have dns issues, so you have to inject the target ip of the url into the container host, using the --add-host option
see:
https://www.thegeekdiary.com/how-to-add-new-host-entry-in-etc-hosts-when-a-docker-container-is-run/

@bionel @duyluong

as far as i can see, the url is reachable (and the page loaded) … so the issues may be caused by waiting time before attempting to reach the elements … or elements not being visible/intractable due to the headless driver.
will let this to other ‘experts’ in locators and so on

Hi @ayesha.khanam,
I saved the page source string in your previous execution to this file test.html (22.3 KB) and see that there is no element with locator on the page:
//*[@id = ‘single-button’ and @type = ‘button’].

You put the get page source command after the delay keyword and increase the delay timeout (30s → 60s) before finding the element.

Thanks

Hey @duyluong

Have added the delays, still the same issue

Wondering if the issue is same as i just raised:

just for my curiosity:

Docker version 1.12.3, build 6b644ec

this is really old. is that Docker-in-Docker?

+ docker build -t katalonpctv .
Sending build context to Docker daemon 557.1 kB
Sending build context to Docker daemon 1.114 MB
Sending build context to Docker daemon 1.617 MB

Step 1/2 : FROM katalonstudio/katalon
 ---> 0ff422e21fbb
Step 2/2 : ADD project /tmp/project
 ---> ecd835534726

why do you need to build a new image, adding the project inside of it? you can simply bind-mount the project at the runtime in the container created using the official image … that will save some time at the execution.

however:

+ xvfb-run -s '-screen 0 1024x768x24'

this size is small. Have you tried running the test on your local machine at this screen size?
Could be that due to the small size, your page is not rendered/displayed correctly therefore the elements you are trying to interact with are not reachable.

@anuradha no, it is not the same issue, since the page content it is received (see the log), therefore the url seems reachable.

@ayesha.khanam also, note that in your log you are exposing the api-key, you may wan’t to censor it …

@kazurayam can you please help me with this issue