Skip to content

Configuration files

kgribov edited this page Mar 13, 2013 · 8 revisions

#Configuration files

Configuration file

Jagger configuration file is a file, which has an extension .conf.xml. It looks like this -

<?xml version="1.0" encoding="UTF-8"?>

<beans:beans
        xmlns="http://www.griddynamics.com/schema/jagger"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.griddynamics.com/schema/jagger
        http://www.griddynamics.com/schema/jagger.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd"
        >

        .....

</beans:beans>

Configuration file can contains jagger components and spring beans, for example -

<beans:beans
        xmlns="http://www.griddynamics.com/schema/jagger"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.griddynamics.com/schema/jagger
        http://www.griddynamics.com/schema/jagger.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd"
        >

        <endpoint-provider xsi:type="endpoint-provider-list">
                <endpoint>http://google.com</endpoint>
                <endpoint>http://google.ru</endpoint>
        </endpoint-provider>

        <beans:bean id="responseSize" class="com.griddynamics.jagger.calculator.ResponseSize"/>

</beans:beans>

Configuration components

###Components type

Some configuration components have more than one type. For example - such components as configuration, test-suite, test, report have only one type. To use this components you need only to create an element with a name of component -

        <report outputReportLocation="test-report.pdf">
            <session-comparators baselineId="777" strategy="worstCase"/>
        </report>

But a lot of components have multiple type choice. Component load has next types - load-tps, load-threads, load-user-group, load-user-groups, load-invocation. To use one of type add attribute xsi:type to your element -

       <load xsi:type="load-tps" value="100" maxThreadNumber="1000"/>

In this example, element load have a type - load-tps, you can configure attributes value and maxThreadNumber.

###Configuration The main jagger configuration component is configuration. It say jagger what to do. You can configure [jagger tests](Test suite) and report with this element. To choose certain configuration - set id of configuration in [propertie file](Configuration properties). Example of configuration -

    <configuration id="exampleConfiguration">
        <test-suite id="JaggerTestSuit">
               <test-group id="myFirstSearchTest">
                   <test id="jaggerPage" testDescription="jaggerPageTest">
                       <load xsi:type="load-tps" value="100" maxThreadNumber="1000"/>
                       <termination xsi:type="termination-iterations" iterations="1000" maxDuration="2h"/>
                   </test>

                   <test id="googlePage" testDescription="googlePageTest">
                       <load xsi:type="load-threads" count="1"/>
                       <termination xsi:type="termination-background" />
                   </test>
               </test-group>
        </test-suite>
        
        <report outputReportLocation="test-report.pdf"/>
    </configuration>

###References Let's image that you have some components that configured by common component -

        <scenario id="sc1" xsi:type="scenario-query-pool" parent="pageScenario">
            <endpoint-provider xsi:type="endpoint-provider-list">
                <endpoint>http://google.com</endpoint>
                <endpoint>http://google.ru</endpoint>
            </endpoint-provider>
        </scenario>

        <scenario id="sc2" xsi:type="scenario-query-pool" parent="pageScenario">
            <endpoint-provider xsi:type="endpoint-provider-list">
                <endpoint>http://google.com</endpoint>
                <endpoint>http://google.ru</endpoint>
            </endpoint-provider>

            <query-provider xsi:type="query-provider-list">
                <query></query>
            </query-provider>
        </scenario>

Scenario sc1 and sc2 have a common component - endpoint-provider. We can make text shorter while using reference.

     <endpoint-provider id="googleEndpoint" xsi:type="endpoint-provider-list">
          <endpoint>http://google.com</endpoint>
          <endpoint>http://google.ru</endpoint>
      </endpoint-provider>

        <scenario id="sc1" xsi:type="scenario-query-pool" parent="pageScenario">
            <endpoint-provider xsi:type="endpoint-provider-ref" ref="googleEndpoint"/>
        </scenario>

        <scenario id="sc2" xsi:type="scenario-query-pool" parent="pageScenario">
            <endpoint-provider xsi:type="endpoint-provider-ref" ref="googleEndpoint"/>

            <query-provider xsi:type="query-provider-list">
                <query></query>
            </query-provider>
        </scenario>

There are two ways to use references. If your component has a multiple type choice you can use reference type. For element scenario reference type equals scenario-ref, for endpoint-provider equals endpoint-provider-ref and etc. Such types have attribute ref. Other components already have this attribute.

###Inheritance Some configuration components have an ability to use inheritance. If you see, that component have an attribute parent - you can set a parent component. Let's we have two scenario components called : pageScenario and gridPageScenario -

    <scenario id="pageScenario" xsi:type="scenario-query-pool">
        <query-distributor xsi:type="query-distributor-round-robin"/>
        <invoker xsi:type="invoker-class" class="com.griddynamics.jagger.PageVisitorInvoker"/>
    </scenario>

    <scenario id="gridPageScenario" xsi:type="scenario-query-pool" parent="pageScenario">
         <endpoint-provider xsi:type="endpoint-provider-list">
              <endpoint>https://jagger.griddynamics.net</endpoint>
         </endpoint-provider>

         <query-provider xsi:type="query-provider-list">
              <query>index.html</query>
              <query>screenshots.html</query>
              <query>download.html</query>
         </query-provider>
    </scenario>

As you can see pageScenario is a parent to component gridPageScenario. It means that gridPageScenario will have the same invoker and query-distributor as pageScenario.

###Import You can use configuration components from another files. To use it - you need to import this files.

For example - you have a file called queryproviders.conf.xml with component query-provider

<beans:beans
        xmlns="http://www.griddynamics.com/schema/jagger"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.griddynamics.com/schema/jagger
        http://www.griddynamics.com/schema/jagger.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd"
        >

       <query-provider id="qp1" xsi:type="query-provider-list">
              <query>index.html</query>
              <query>screenshots.html</query>
              <query>download.html</query>
       </query-provider>        

</beans:beans>

And we have another file, where we want to use this component. We need to import file queryproviders.conf.xml. Add next construction - <beans:import resource="queryproviders.conf.xml"/>.

Example -

<beans:beans
        xmlns="http://www.griddynamics.com/schema/jagger"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.griddynamics.com/schema/jagger
        http://www.griddynamics.com/schema/jagger.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd"
        >

       <beans:import resource="queryproviders.conf.xml"/>

       <scenario id="pageScenario" xsi:type="scenario-query-pool">
           <query-distributor xsi:type="query-distributor-round-robin"/>
           <query-provider xsi:type="query-provider-ref" ref="qp1"/>
       </scenario>     

</beans:beans>

###Custom components You have an ability to add your own components, you can read about it [here](Custom component).

Clone this wiki locally