# Test script not working

**URL:** <https://forum.universal-robots.com/t/test-script-not-working/18508>\
**Category:** URScript\
**Created:** [January 7, 2022, 1:05pm UTC](https://forum.universal-robots.com/t/test-script-not-working/18508 "2022-01-07T13:05:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefan.keller](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@stefan.keller](https://forum.universal-robots.com/u/stefan.keller)\
**Post date:** [January 7, 2022, 1:05pm UTC](https://forum.universal-robots.com/t/test-script-not-working/18508/1 "2022-01-07T13:05:17Z")

</div>

Just wondering what is wrong with my test script.

```auto
import socket
import time

HOST = '169.254.63.28'
PORT = 30002

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
    
i = 1
while i < 2:
    s.send(("set_digital_out(0,True)"+"\n").encode('utf8'))
    time.sleep(0.5)
    s.send(("set_digital_out(0,False)"+"\n").encode('utf8'))
    time.sleep(0.5)
    s.send(("popup(hey, title='halt', warning=True, blocking=True)"+"\n").encode('utf8'))
    s.send(("movej([-1.200691048298971, -1.6863962612547816, -1.206042766571045, \
        -1.8198558292784632, 1.5693081617355347, 1.914101481437683], \
        a=1.200691048298971, v=1.200691048298971" + "\n").encode('utf8'))
    time.sleep(5)
    s.send(("movej([-1.2551572958575647, -1.7164651356139125, -1.762454628944397, \
        -1.2335349184325715, 1.5693681240081787, 1.859632134437561], \
        a=1.200691048298971, v=1.200691048298971" + "\n").encode('utf8'))
    time.sleep(5)

```

The only thing working is digital\_out\_0 switching on and off  
But no popup or movement of the arm.

---

<div class="post-metadata">

**Author:** ![anon32693620](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@anon32693620](https://forum.universal-robots.com/u/anon32693620)\
**Post date:** [January 7, 2022, 1:52pm UTC](https://forum.universal-robots.com/t/test-script-not-working/18508/3 "2022-01-07T13:52:13Z")

</div>

For your popup, is hey a string you defined before this call? If not you will need to put it as a string when you send it like you do ‘halt’ or it may think it is a variable being called. Also, It looks like you are missing a closing ) on your movej commands before the “\n”.

Example popup from URScript manual:  
popup(“here I am”, title=“Popup #1”,blocking=True)

---

<div class="post-metadata">

**Author:** ![stefan.keller](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@stefan.keller](https://forum.universal-robots.com/u/stefan.keller)\
**Post date:** [January 7, 2022, 2:59pm UTC](https://forum.universal-robots.com/t/test-script-not-working/18508/4 "2022-01-07T14:59:06Z")

</div>

I already tried this before but it doesn’t work unfortunately

```auto
    s.send(("popup("hey", title="halt", blocking=True)"+"\n").encode('utf8'))
                    ^
SyntaxError: invalid syntax

```

also I can’t compile the script anymore if I add an closing ) after movej

---

<div class="post-metadata">

**Author:** ![anon32693620](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@anon32693620](https://forum.universal-robots.com/u/anon32693620)\
**Post date:** [January 7, 2022, 3:03pm UTC](https://forum.universal-robots.com/t/test-script-not-working/18508/5 "2022-01-07T15:03:30Z")

</div>

I believe it would need to be setup as this so that it includes the "

```auto
    s.send(("popup(\"hey\", title=\"halt\", blocking=True)"+"\n").encode('utf8'))

```

If it still gives a syntax error then try

```auto
    s.send(("popup('hey', title='halt', blocking=True)"+"\n").encode('utf8'))

```

---

<div class="post-metadata">

**Author:** ![stefan.keller](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@stefan.keller](https://forum.universal-robots.com/u/stefan.keller)\
**Post date:** [January 7, 2022, 3:35pm UTC](https://forum.universal-robots.com/t/test-script-not-working/18508/6 "2022-01-07T15:35:00Z")

</div>

> s.send((“popup("hey", title="halt", blocking=True)”+“\n”).encode(‘utf8’))

this is it, thanks 😀  
movej works now too with the added )

> also I can’t compile the script anymore if I add an closing ) after movej

I guess I messed this up in the first try
