WebPagetest Forums
Scripting: if/else/endif not working - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: Scripting: if/else/endif not working (/showthread.php?tid=14945)



Scripting: if/else/endif not working - jupiterw - 06-20-2017 09:53 AM

Hey guys,
I'm trying to script with if/else/endif but it doesn't seem to work.
This is the script that I used:

if cached 0
navigate google.com
else
navigate yahoo.com
endif

When I try to run the script above, it never goes to google.com and will always evaluate the else condition.
https://www.webpagetest.org/result/170619_RF_1WKG/

I also tried to follow the documentation and tried to follow the format with the example script given for if/else/endif

https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/scripting#TOC-if-else-endif

if run 1
if cached 0
navigate google.com
endif
else
navigate yahoo.com
endif

But I get the same issue. Everytime I run the script above, It evaluates the else condition.

https://www.webpagetest.org/result/170619_8S_1WS6/

Am I doing something wrong or is this a bug with if/else/endif?


RE: Scripting: if/else/endif not working - jupiterw - 09-26-2017 08:46 AM

It's been around 3 months since i've posted this but can anyone confirm if this is a known bug or if they are having similar issues?