Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
6413 Vistas

Hi!

I'm trying to test the load response of an OpenERP module that I've been developing. I've managed to authenticate and read from my model thanks to this tutorial http://selvam4u.wordpress.com/2011/05/25/load-testing-openerp-with-jmeter/ and the kind help of Delphine Lemire!

I'd like now test the creation and update of existing records, but I can't find anywhere the syntax to do such actions. Where can I find any working example or is anyone willing to share knowledge about how to call the create and/or the write methods?

Thanks in advance!

 

 

Avatar
Descartar
Autor Mejor respuesta

Finally got it to work. Found a thread on Lauchpad reporting a bug on creation partners with JMeter and the code there helped me understand how this should work, so I'll leave here the XML configuration file to create records on a custom module on OpenERP.

    <?xml version='1.0'?>
    <methodCall>
        <methodName>execute</methodName>
        <params>
            <param>
                <!-- Select your database -->
                <value><string>may_9</string></value>
            </param>
            <param>
                <!-- User uid, 1, why not? -->
                <value><int>1</int></value>
            </param>
            <param>
                <!-- user login -->
                <value><string>admin</string></value>
            </param>
            <param>
                <!-- identify your object -->
                <value><string>generic.request</string></value>
            </param>
            <param>
                <!-- and your action -->
                <value><string>create</string></value>
            </param>
            <param>
                <!-- here comes the values to insert -->
                <value>
                <!-- create a struct where you identify the field name, the field type and the value you want to insert in it -->
                <struct>
                    <member>
                        <name>name</name>
                        <value><string>JMeter Request</string></value>
                    </member>
                    <member>
                        <name>subject_type</name>
                        <value><int>1</int></value>
                    </member>
                    <member>
                        <name>responsible_name</name>
                        <value><int>4</int></value>
                    </member>
                    <member>
                        <name>request_description</name>
                        <value><string>Desc</string></value>
                    </member>
                    <member>
                        <name>stating_reasons</name>
                        <value><string>stating reasons</string></value>
                    </member>
                    <member>
                        <name>expected_date</name>
                        <value><string>08/31/2014</string></value>
                    </member>
                    </struct>
                </value>
            </param>
        </params>
    </methodCall>

And that should work fine!  
Hope this helps :)

 

Avatar
Descartar

Trying the code you provided in the HTTP Sampler in J Meter. I am putting the code in Body Data of the HTTP Request but it is not creating new records.

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 25
1096
0
nov 24
1347
0
jun 24
1416
1
jun 24
1875
0
oct 23
1962