具有 Ant 顺序 + 并行执行的 Selenium Grid [英] Selenium Grid with Ant sequential + parallel execution

查看:21
本文介绍了具有 Ant 顺序 + 并行执行的 Selenium Grid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 selenium grid 2 设置运行 selenium 测试.我的测试更加依赖.我必须很好地定义我的顺序运行 &并行运行.附上我的 build.xml 文件以供参考.在顺序节点内部,我有许多具有不同目标的并行节点.我在运行这个 build.xml 时遇到了不一致的问题.

I am trying to run the selenium tests with selenium grid 2 set up. My tests are more dependent . I have to well-define my sequential run & parallel run. Attaching my build.xml file for ref. Inside sequential node I have many parallel nodes with different targets. I am facing inconsistency issues in running this build.xml.

有时它会选择第二个并行节点的目标 &有时不是.它也没有给出错误.我尝试在详细模式下运行 ant 命令,仍然没有得到 ant 异常.

Some times it picks up the targets of 2nd parallel node & sometimes its not. It is not giving error also. I tried running ant command in verbose mode, still not getting ant exceptions.

如果有人在这方面提供帮助,我会很高兴.

Will be glad if someone helps in this regard.

<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
Anjana

推荐答案

尝试 QAF(原 ISFW)您可以在使用/不使用网格的情况下并行运行测试.在您的情况下,以下配置文件可以满足您的要求:

Try QAF (formerly ISFW) where you can run test parallel with/without use of grid. In Your case following config file can fulfill your requirement:

<suite name="Sample Test Automation" verbose="0" parallel="tests">
<test name="Set1" > 
    <parameter name="selenium.server" value="server1"/>
    <parameter name="selenium.port" value="port"/>

    <!-- group or class or package entry as per testNG standard 
     -->    
    <classes>
    <class name="qualified name of class"></class>
    </classes>>     
</test>


<test name="set2" > 
    <parameter name="selenium.server" value="server2"/>
    <parameter name="selenium.port" value="port"/>

    <!-- <packages>
        <package name="package name" />
    </packages> 
     -->    
    <classes>
    <class name="qualified name of class"></class>
    </classes>
</test> 

</suite>

这篇关于具有 Ant 顺序 + 并行执行的 Selenium Grid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆