Ant - continue to complete the goal, even if one goal is completed to automate selenium

Is there a way to make Ant not close even if one of the goals is completed?

For example, several goals can be fulfilled, and if the first one stops, selenium will freeze. All other test testers that run in parallel at other target stops.

How to make Ant to continue to fulfill other goals, even if they are completed.

I tried to give -k at the target level, but not use it. We have failonerror set to true. Does it matter?

Here is my build file:

 <target name="startServerRC" depends="startServerhub"> <echo>Starting Selenium Server...</echo> <java jar="${lib.dir}/selenium-server-standalone.jar" fork="true" spawn="true"> <arg line="-port 5555"/> <arg line="-log log.txt"/> <arg line="-firefoxProfileTemplate"/> <arg value="${lib.dir}/ff_profile"/> <arg line="-userExtensions"/> <arg value="${lib.dir}/user-extensions.js"/> <arg line="-role node"/> <arg line="-hub http://localhost:4444/grid/register "/> <arg line="-maxSession 10"/> <arg line="-maxInstances=10"/> </java> </target> <!-- Initialization --> <target name="init" depends="startServerRC" > <echo>Initlizing...</echo> <delete dir="${classes.dir}" /> <mkdir dir="${classes.dir}"/> </target> <!-- Complies the java files --> <target name="compile" depends="init"> <echo>Compiling...</echo> <javac debug="true" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" /> </target> <target name="CItarget"> <sequential> <antcall target="compile"/> <parallel> <antcall target="run"/> <antcall target="run_PSDATA"/> </parallel> <parallel> <antcall target="run_PreData"/> <antcall target="run_DFPPulls"/> <antcall target="run_AdTechPulls"/> <antcall target="run_AppnexusPulls"/> <antcall target="run_FTPPulls"/> <antcall target="run_OASPulls"/> <antcall target="run_GDFPPulls"/> <antcall target="run_FreewheelPulls"/> <antcall target="run_ThirdPartyPulls"/> </parallel> <parallel> <antcall target="run_PostData"/> <antcall target="run_Sales"/> </parallel> <parallel> <antcall target="run_Administration"/> <antcall target="run_E2EPartner360"/> <antcall target="run_Sales"/> <antcall target="run_Finance"/> <antcall target="run_Loaders"/> <antcall target="run_Accounts"/> <antcall target="run_Adops"/> </parallel> <parallel> <antcall target="run_Alerts"/> <antcall target="run_CustomFields"/> </parallel> <antcall target="stop-selenium"/> </sequential> </target> 

Thanks in advance

+1
source share
1 answer

You can try try-catch from ant -contrib.

Example from the link:

 <trycatch property="foo" reference="bar"> <try> <fail>Tada!</fail> </try> <catch> <echo>In &lt;catch&gt;.</echo> </catch> <finally> <echo>In &lt;finally&gt;.</echo> </finally> </trycatch> 

If something does not work out, you will simply repeat something (or mark it). Finally, the part works fine if you need to make sure that the servers are closed at the end, even if something fails between them.

Also setting failonerror="false" should make ant not build fail on errors.

+2
source

Source: https://habr.com/ru/post/912735/


All Articles