Current time: 12-18-2017, 03:06 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script not being picked up from REST api via curl
09-23-2017, 03:36 AM
Post: #1
script not being picked up from REST api via curl
Hi,

I'm trying to submit a script though curl, but it seems that it isn't being picked up. This is the syntax I use:

curl -X POST http://www.webpagetest.org/runtest.php \
-F 'f=json' \
-F 'url=https://www.example.com' \
-F 'k=mysupersecretkey' \
-F 'script=@script_file_name'


My script consist of just:
navigate https://yahoo.com
navigate https://ca.news.yahoo.com


It works, but the only site visited is example.com, the result is exactly like if I had no "script" instruction. If I point to a non-existing file I get an expected error from curl. If I put invalid command in the wpt script, I do not get any error and get the same behaviour as if I had no script at all...

What am I doing wrong here?

Also, why do we need a url if we have a script (trying to automate some test where I could change just the wpt script...).
Find all posts by this user
Quote this message in a reply
09-26-2017, 06:17 AM
Post: #2
RE: script not being picked up from REST api via curl
This seemed to work for me when I tried it

https://www.webpagetest.org/result/17092...565b295eb/

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
09-26-2017, 10:42 PM
Post: #3
RE: script not being picked up from REST api via curl
This was with the `-F 'script=@script_file_name'` curl syntax?

It works for me if I put the content of a script after the equal sign, but not when I try to load a file with the at sign...
Find all posts by this user
Quote this message in a reply
09-26-2017, 10:49 PM
Post: #4
RE: script not being picked up from REST api via curl
Yup just like this

Code:
curl -X POST http://www.webpagetest.org/runtest.php \
-F 'f=json' \
-F 'url=https://www.example.com' \
-F 'k=key' \
-F 'script=@wpt-script.txt'

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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