Search code examples
javascriptwebkitautomated-testsphantomjs

How can I get the current script name in PhantomJS?


What is the equivalent of __filename variableof nodejs in Phantomjs? I would like to get the name of the currently executing script.


Solution

  • You can get the current script name with phantom.scriptName or with system.args[0].

    as said here