Current time: 03-22-2019, 04:07 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using API for scripting
08-21-2018, 11:54 PM
Post: #5
RE: Using API for scripting
(07-12-2018 12:06 AM)pmeenan Wrote:  You need to urlencode the script and pass it as script=xxxxxxx.

Mostly likely that's the issue for the OP, that being said, for me this error is being thrown if script starts with anything else than 'navigate', e.g.

Code:
<?php

$query = [
  'k' => 'MY_KEY',
  'location' => 'Prague:Chrome.Cable',
  'f' => 'json',
  'fvonly' => '1',
  'private' => '1',
  'video' => '0',
  'noopt' => '1',
  'noheaders' => '1',
  'pngss' => '1',
  'ignoreSSL' => '1',
  'script' => 'navigate https://domain.cz/login setValue id=userNameInput USERNAME setValue id=passwordInput PASSWORD clickAndWait id=submitButton navigate https://domain.cz/page1 navigate https://domain.cz/page2'
];

$query['script'] = str_replace(' ', "\t", $query['script']);

echo 'http://www.webpagetest.org/runtest.php?'. http_build_query($query) . PHP_EOL;
?>

The script above which worked perfectly via UI is:

Code:
logData    0
navigate    https://domain.cz/login
logData    1
setValue    id=userNameInput    USERNAME
setValue    id=passwordInput   PASSWORD
clickAndWait    id=submitButton
navigate    https://domain.cz/page1
navigate    https://domain.cz/page2

I get the OP`s error if I start my script with logData, it works however if I start with navigate.

Still playing around as I get the job accepted but it looks that script part of logging in does not work, just the first line of navigate aka going to right URL to start with.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Using API for scripting - kk123 - 04-05-2018, 09:23 AM
RE: Using API for scripting - pmeenan - 04-06-2018, 10:33 PM
RE: Using API for scripting - psadasivuni - 07-11-2018, 11:19 PM
RE: Using API for scripting - pmeenan - 07-12-2018, 12:06 AM
RE: Using API for scripting - rock3t - 08-21-2018 11:54 PM

Forum Jump:


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