Current time: 03-24-2017, 07:57 AM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting Not Working On Private Instance
03-14-2017, 05:49 AM (This post was last modified: 03-15-2017 11:02 PM by jhood4.)
Post: #1
Scripting Not Working On Private Instance
Hi guys, I was hoping that someone could help me out with this. I am trying to test the scripting functionality of my local instance of this product, but even the most basic scripts don't seem to work. I have confirmed that my script works at, but when I try the exact same script on my local instance, it fails. Could I be missing something in my configuration or has anybody else experienced this issue and knows of a fix. My script looks like this(tab-delimited, not spaces):

logData 0
logData 1

Any advice would be greatly appreciated.


I figured, I would add the errors that I am getting when I attempt to test this script on my local instance.

If i run it through the UI, I get the following error:

The testing completed but failed.
Timed out waiting for the browser to start.
Waterfall Screen Shot Video
First View: Test Data Missing
Repeat View: Test Error: Skipped repeat view, first view failed: Timed out waiting for the browser to start.

In reality, I am writing a simple php script using curl to start tests, collect the test results and store results in a database. An example of the curl call I am using to start the test is below:

$link = urlencode(file_get_contents('test.txt'));

$startTest = curl_init();
curl_setopt_array($startTest, array(
'location' => 'Office_wptdriver',
'f' => 'json',
'script' => $link,
'video' => 1

$response = curl_exec($startTest);

//The script continues from here to check the test status then collect the results once it has been completed.

If i remove the script option and manually specify single URLs, using the url option, the script runs fine and all data is stored correctly. However, when I use the script option and point to my URL encoded version of the script file I wrote, I get the following error:

{"statusCode":400,"statusText":"Invalid Script (make sure there is at least one navigate command and that the commands are tab-delimited). Please contact us if you need help with your test script."}

The URL encoded script looks like this:​

I have also tested this without encoding my script file with the same results. There are definitely navigate commands in my script and they are tab-delimited so I'm not sure what I am doing wrong.

I have also verified that all necessary PHP modules from the installation documentation are installed on the server, so I don't believe that is a problem.

Logs don't seem to give me any truly useful information to narrow down the issue.

Anyone else experiencing or have experience this? Any help would be greatly appreciated.
Find all posts by this user
Quote this message in a reply
03-16-2017, 07:26 AM
Post: #2
RE: Scripting Not Working On Private Instance
I tried your script on my private instance, and it works. I just spinned up a standard webpagetest AMI, didn't change anything, so default settings work. I have however had a problem with the agent initially, where browsers were not installing, unless I remote desktop into the agent and watch it. :-D But if URLs work fine for you, and it is only the script that fails, shouldn't be that. Maybe double check that you run script with the correct location/browser settings just in case? It can also help to remote desktop into the agent you are using and to watch what's happening when you run the test. You might see the reason browser is not starting in the wptdriver window.

I got the same error as you when I was curling my scripts just two days ago, the problem was in the encoding. The string you provided has extra characters after, can that be a problem? I also noticed that you are not passing API key with curl. Did you disable having to provide keys? If not, you need to provide a key, they are stored in the settings/keys.ini on the server.

Hope at least some of this was useful.
Find all posts by this user
Quote this message in a reply
03-16-2017, 08:11 AM
Post: #3
RE: Scripting Not Working On Private Instance
Hi Hali, thanks for your reply. That is odd as I am running a local instance with the default settings for everything as far as I can tell. I am running the server with PHP 7, I am not sure if maybe that could cause an issue.

I do not have the optional programs installed such as imagemagick or exiftool as I was attempting to keep this as basic as possible. I have verified that all required programs/modules/etc are installed by navigating to and all required items have green checks.

I only have one agent installed so by default, it should and does hit the correct location(I do manually tell it what location to use anyway, but I am not telling it which browser).

I have logged into to my server to watch the tests run and its odd. If I run the script from inside the browser(GUI), the browser(Chrome) pops up, but it is never able to locate the pages I am trying to navigate to and the test fails, however, when I attempt to run it in the script that I wrote, it errors out before it even makes it to the server and with the error from my original post(Invalid Script).

I didn't notice the extra characters after, but I will look at that and see if maybe that resolves the issue.

Per your question about an API key, as far as I know since this is a private instance, I do not need one. I believe it is possible to set it up to use one, but I have no use for that if I don't need it. If it is a requirement to run scripts, I will gladly set up a key, but I'd like to be sure that is the issue before I spend the time on it.

Thanks again for your reply. At the very least, you gave me a few extra things to verify and a good place to begin troubleshooting. If my response helps you think of anything else, please let me know.
Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)