WebSocket Connect Keywords FREE

Use this plug-in to make a web socket connection to your server,send and receive message.

114

How to use:

Install the plugin.

//Sample code to show how to use

import websocketConnection.WebSocketConnect

import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;

import org.eclipse.jetty.websocket.client.WebSocketClient;

import org.eclipse.jetty.websocket.api.annotations.WebSocket;

import java.net.URI;

//Sample server

String destUri = "ws://echo.websocket.org";

//Sample msg

String msg ="This is test API request"

WebSocketClient client = new WebSocketClient();

socket = new WebSocketConnect(msg);

try { client.start();

URI echoURi = new URI(destURi);

ClientUpgradeRequest request = new ClientUpgradeRequest();

client.connect(socket,echoURi,request);

//wait for socket connection to close

socket.awaitClose(5,TimeUnit.SECONDS);

System.out.printf("Message has reached me : %s%n",socket.msgtoReturn);

} catch (Throwable t) {

t.printStackTrace();

} finally { try { client.stop(); } catch (Exception e) { e.printStackTrace(); } }

Visit Katalon Forum for Plugin related discussions.

3.4
5 Rating(s)
tinggege
April 30, 2019

unable to resolve class websocketConnection

Abi
May 6, 2019

is the plugin installed correctly. Do you see websocketConnection package in your keywords ?

Krisnawan
May 6, 2019

Hi Abi, I tried your solution but still cannot resolve websocketConnection.WebSocketConnect

Abi
April 30, 2019

Hi tinggege i suggest you ask your questions in the forum. I believe you missed to add the necessary lib. Try adding import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.api.annotations.WebSocket; import java.net.URI;

Load more Show less
Araminta
April 5, 2019

Zachary Hilfiger
April 5, 2019

Thanks Abi. Looking for other plugins from you.

Bonnie Townsends
April 5, 2019

Nice one! Thank you.

Donald Jacobs
April 5, 2019

It failed to install, uninstalled it.

Abi
April 7, 2019

Hi Donald, Could you provide more info on what version of Katalon Studio you are using ? Any error message?

API keys are required in Katalon Studio Commandline Execution. Generate Key
Information
Project details
Version
1.0.1
Type
Custom Keywords Plugin
Last updated
May 15, 2019 12:20 am
Publisher
Privacy and License Agreement