# Testing VTK Web workflow

**URL:** https://discourse.vtk.org/t/testing-vtk-web-workflow/13256
**Category:** Web
**Tags:** web, python
**Created:** [February 5, 2024, 10:19am UTC](https://discourse.vtk.org/t/testing-vtk-web-workflow/13256 "2024-02-05T10:19:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [February 5, 2024, 10:19am UTC](https://discourse.vtk.org/t/testing-vtk-web-workflow/13256/1 "2024-02-05T10:19:33Z")

</div>

Hello,

I’m having trouble setting up a test server with VTK web, ie not testing the Python function in the protocols but the exported rpc.

So far, I have read these pages:

> <https://github.com/Kitware/VTK/blob/master/Web/Python/vtkmodules/web/testing.py>

> <https://github.com/Kitware/VTK/blob/master/Web/Python/Testing/Python/TestSerializeRenderWindow.py>

[https://docs.vtk.org/en/latest/api/python/vtkmodules/vtkmodules.test.Testing.html](https://docs.vtk.org/en/latest/api/python/vtkmodules/vtkmodules.test.Testing.html)

Those only seem to talk about the functions testing, not the server testing.  
Do you have any code or do you know of any code that tests this part?

Thanks!

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [February 5, 2024, 3:20pm UTC](https://discourse.vtk.org/t/testing-vtk-web-workflow/13256/2 "2024-02-05T15:20:39Z")

</div>

I know we have some cmake tests that start a server and a client that connect to it. But it has been a while and I don’t remember when those are.

The latest set of tests are on the trame side (same tech), which just script the browser from Python and run via pytest. [trame-client/tests at master · Kitware/trame-client · GitHub](https://github.com/Kitware/trame-client/blob/master/tests/)

You can find also some in trame-vtk where we do image comparison too.

HTH,

Seb

---

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [February 6, 2024, 3:30pm UTC](https://discourse.vtk.org/t/testing-vtk-web-workflow/13256/3 "2024-02-06T15:30:58Z")

</div>

Thanks for the resource!

We managed to launch the server using the FixtureHelper. Then, we connect to it via websocket but we can’t figure out a way to call a Rpc, do you have any example for that? Is there another way to call a protocol from the server?

```auto
ws = websocket.WebSocket()
ws.connect("ws://localhost:1234/ws")
ws.send("create_visualization")
response = ws.recv()

```

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [February 8, 2024, 4:13pm UTC](https://discourse.vtk.org/t/testing-vtk-web-workflow/13256/4 "2024-02-08T16:13:14Z")

</div>

A while back we were creating a “test” client app which you can drive from python (click - run test button, check results)…  
In other words, we never (re-)implemented the wslink protocol in Python from the client point of view.
