Skip to content

Local test

Brecht De Man edited this page Nov 17, 2020 · 5 revisions

OS X & Linux

On Mac OS X, Python comes preinstalled, as with most Unix/Linux distributions.

Open the Terminal (find it in Applications/Terminal or via Spotlight), and go to the folder you downloaded. To do this, type cd [folder], where [folder] is the folder where to find the pythonServer.py script you downloaded. For instance, if the location is /Users/John/Documents/WebAudioEvaluationToolbox/, then type

cd /Users/John/Documents/WebAudioEvaluationToolbox/

Then hit enter and run the Python script by typing

python python/pythonServer.py

and hit enter again. See below:

Alternatively, you can simply type python (followed by a space) and drag the file into the Terminal window from Finder.

You can leave this running throughout the different experiments (i.e. leave the Terminal open). Once running the terminal will report the current URL to type into your browser to initiate the test, usually this is http://localhost:8000/.

On OS X 10.10 or newer, you may get a dialogue asking if Python can accept incomming connections, click yes.

To start the test, open the browser and type

localhost:8000/test.html?url=your-test.xml

(where your-test.xml is the path to the test configuration XML file) and hit enter. The test should start:

To quit the server, either close the terminal window or press Ctrl+C on your keyboard to forcibly shut the server.

Windows

On Windows, Python is not generally preinstalled and therefore has to be downloaded and installed to be able to run scripts such as the local webserver, necessary if the tool is hosted locally.

Once installed, simply double click the Python script pythonServer.py in the python folder within the folder you downloaded.

You may see a warning like the one below. Click Allow access.

The process should now start, in the Command prompt that opens:

You can leave this running throughout the different experiments (i.e. leave the Command Prompt open).

To start the test, open the browser and type

localhost:8000/test.html?url=your-test.xml

(where your-test.xml is the path to the test configuration XML file) and hit enter. The test should start.

If at any point in the test the participant reports weird behaviour or an error of some kind, or the test needs to be interrupted, please notify the experimenter and/or refer to the Troubleshooting section.

When the test is over (the subject should see a message to that effect), the output XML file containing all collected data should have appeared in saves/. The names of these files are test-0.xml, test-1.xml, etc., in ascending order. The Terminal or Command prompt running the local web server will display the following file name. If such a file did not appear, please again refer to Troubleshooting.

It is advised that you back up these results as often as possible, as a loss of this data means that the time and effort spent by the subject(s) has been in vain. Save the results to an external or network drive, and/or send them to the experimenter regularly.

To start the test again for a new participant, you do not need to close the browser or shut down the Terminal or Command Prompt. Simply refresh the page or go to localhost:8000 again, a new session will be created.

Clone this wiki locally