How to invoke an url using ant

645 Views Asked by At

How can I invoke an url using ant ? I am using a macro defined as :

<macrodef name="open-url">
  <sequential>
    <invoke description="Login Page" url="someurl" />
  </sequential>
</macrodef>

and in my build file:

<property name="parent-folder" value="../../../.././" />
<import file="open-url.xml"/>
<import file="${parent-folder}/sub-build"/>`    
<target name="test" depends="xyz">`
  <!-- do something-->`
</target>`

in sub-build:

<target name="xyz">
  <ant antfile="open-url.xml" target="open-url"/>
</target>

The build and macro is in the same folder and sub-build is in parent folder.

I am unable to invoke the url.

1

There are 1 best solutions below

0
On

You cannot do this with ant. Even BSF supported languages do not work since an ant build.xml file is not a browser window hence functions like XMLHttpRequest() will not work. Other than writing your own custom task I don't see how you could accomplish your task.