Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Set karate mock server port

Is there a a way to set a port to my desired one when I am starting a mock serve with karate.start
so instead of getting the port like this, which will start server in some port and return it:

def startMockServer = () => karate.start('path.feature').port

Have a possibility similar to this:

def startMockServer = () => karate.start('path.feature', '8080')

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, try this:

* karate.start({ mock: 'mock.feature', port: 8080 })

This is mentioned in the docs: https://github.com/karatelabs/karate/tree/master/karate-netty#within-a-karate-test

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading