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.
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.
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:
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.
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.
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/
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.
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 …