Docstoc

Translating IPM to test requirement

Document Sample
Translating IPM to test requirement Powered By Docstoc
					1. Translating IPM of Web Pages to XML format Test
   Requirement
   After the input parameter models of the Web Pages have been constructed we start to
translate the IPM into test requirement with xml files. The test requirement should
describe the test subjects in terms of physical parameters and the actual values for each
parameter. Accordingly, those test requirement xml files will be used to generate real test
suites.


   1.1 The definition of test requirement xml file
   The root element in xml file is the testrequirement element. It has five attributes:
page,     baseurl,   loginurl,   pageurl and      identifier. The page attribute designates
which page is going to be tested; the baseurl attribute is considered to be the absolute
address of the Web Application being tested; the loginurl attribute is the relative URL
used to login the Web Application before the test cases are executed; the pageurl attribute
is the relative URL to navigate to the Web Page that is going to be tested and the
identifier attribute is used to distinguish the test cases generated for this page with other
Web Pages.


   The testrequirment contains the characteristic child element. Each characteristic
element is corresponding to one characteristic identified in IPM. Test cases will be
generated for each characteristic based on the combination strategy selected and the final
test suite is constructed by taking the union of the test cases generated from each
characteristic.


   The child element of characteristic is the inputparam element. It describes the
physical parameter and values for the parameters. Each inputparam element is assigned
at least two attributes. One is name attribute that represents the physical name of the html
elements in Web Pages. The other is type attribute that describes what kind of operation
will be executed when generating the real test suite from the test requirement. Hereto,
there are four types of inputparam element defined and the definition of their child
elements are different from each other based on the type attribute.
   The first type of inputparam element is “form” type that corresponds to the HTML
form in Web Pages. This type of inputparam does not contain any child element. The
name of the HTML form is presented by the name attribute.
   The second type of inputparam element is “inputfield” type. It represents HTML
input fields (text input, text area, password and hidden input) that appear on the web page
and will be sent to the server directly. The only child element of this type of inputparam
is value element that will be described in latter paragraph.
   The “selectfield” type of inputparam element represents HTML select element on the
web page and it also has value child element.
   The final type of inputparam is a special “xml” type. In VIA project, not all of the
HTML elements are sent to the server directly. Some of them are encoded to xml format
data and then the xml data is assigned to a specific Hidden input field. So the input
parameters identified in IPM, which will be encoded to xml, are mapped to the field child
element instead of inputparam element. The name attribute of this type inputparam
indicates which Hidden input field will be assigned to the xml data. The XML schema
that describes the structure of xml data is presented by another attribute xmlns.
   The field element is corresponding to the input parameters that will be encoded to xml.
It has attribute name and fieldvalue child element.
   Depending on the way of how the parameter will be sent to the server, the values for
each parameter in IPM are presented by either value element or fieldvalue element. If the
parameter will be sent to the server directly, each value will be mapped to a value
element as a child element of inputparam. Otherwise, each value will be mapped to a
fieldvalue element as a child element of field.




   1.2 Translation example- Points of Contact
   We will take Points of Contact as an example to illustrate how to translate the IPM for
Web Portals of VIA project into test requirement xml file. Table 1 below shows the input
parameter model and Figure 1 shows the screenshot that the input parameter model built
on. Figure 2 shows the result test requirement file for Points of Contact page.
   From Figure 2 we can see that the root element of xml is testrequirement element.
The page attribute indicates the page tested is PointsOfContact; the baseurl means that
the      absolute      HTTP        address     to      access      VIA       project   is
http://ovid.research.avayalabs.com:8000/via/; the pageurl "account/contacts" represents
the relative URL to navigate to PointsOfContact page. The identifier “PC” comes from
the abbreviation of the word Points and Contact.
   Four child characteristic elements of testrequirement element are corresponding to
four characteristics in IPM. We will take create electronic email contacts characteristic
as an example to describe how the input parameters of the characteristic in IPM is
translated into inputparam element in xml file. The first input parameter in IPM is
Action, it will be mapped to an inputparam element. The type attribute “inputfield” and
the name attribute “cmd” indicate that physical parameter of Action is a HTML input
field whose name is “cmd”. Because this parameter only has one block, inputparam
only has one child value element whose value is “save”.
   The second input parameter in IPM is Name and it has four blocks. So the result
inputparam element has name attribute “name” and type attribute “inputfield”. It has
four child value elements corresponding to four blocks of the parameter. Because the
second block requires a unique valid string, we assign the second value element with
attribute unique = “true”, which indicates that if we use this element for multiple times
with a selected combination strategy to generate test cases, we should ensure that its
value is different at each time.
   The left five input parameters will be encoded to xml and assigned to a hidden input
field named state before sent to the server. So we create one inputparam element with
type “xml” and name attribute “state”. Then the parameters are translated into field as
child elements of inputparam element. The parameter name in IPM is translated into the
name attribute of field element and the blocks are then mapped to fieldvalue elements as
children of field.
Parameters for create electronic email contacts characteristic
Parameter          Block 1         Block 2             Block3             Block4 Constrains
Action             Save
Name               Blank           Unique Valid        Non-unique valid   Invalid
type               email
function           mail
Content Parameter HTML             Plaint text
External
Parameter               TRUE             FALSE
Email Address      blank           Valid address       Invalid address
Parameters for create SMS contacts characteristic
Parameter          Block 1         Block 2             Block3             Block4 Constrains
Action             Save
Name               Blank           Unique Valid        Non-unique valid   Invalid
type               sms
function           sms
External
Parameter               TRUE             FALSE
Email Address      blank           Valid address       Invalid address

Parameters for create Voice contacts characteristic
Parameter          Block 1         Block 2            Block3              Block4 Constrains
Action             Save
Name               Blank           Unique Valid       Non-unique valid    Invalid
type               voice
function           voice
                                   Valid phone        Invalid Phone
Number             Blank           number             number
Parameters for contacts characteristic
Parameter          Block 1         Block 2            Block3              Block4 Constrains
Submit Action      Test            Modify             Load                Delete
Available Contact The first        The last contact   Between the first
                   contact                            and the last
Table 1: The IPM for Points of Contact page of VIA project




Figure 1: The screenshot of Points of Contact page

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

<testrequirement
  page ="PointsOfContact"
  baseurl = "http://ovid.research.avayalabs.com:8000/via/"
  loginurl = "login"
  pageurl = "account/contacts"
  identifier = "PC"
  >
  <characteristic>
    <inputparam name ="acctform" type = "form"></inputparam>
    <inputparam name = "cmd" type = "inputfield">
      <value>save</value>
    </inputparam>
    <inputparam name = "name" type = "inputfield">
      <value></value>
      <value unique="true">Contact</value>
      <value>Contact</value>
   <value>Contact</value>
   <value>Con,tact</value>
 </inputparam>

  <inputparam name = "state" type = "xml" xmlns="http://xml.avaya.com/rome/via/contact>
    <field name = "type" >
      <fieldvalue>email</fieldvalue>
    </field>
    <field name = "type" >
      <fieldvalue>email</fieldvalue>
    </field>
    <field name = "param" node_type="CDATA">
        <fieldvalue>HTML</fieldvalue>
        <fieldvalue>PLAIN</fieldvalue>
    </field>
    <field name = "param" node_type="CDATA">
        <fieldvalue>true</fieldvalue>
        <fieldvalue>false</fieldvalue>
    </field>
    <field name = "address" node_type="CDATA">
        <fieldvalue></fieldvalue>
        <fieldvalue>wqxiang2001@gmail.com</fieldvalue>
        <fieldvalue>wqxiang@2001@gmail.com</fieldvalue>
    </field>
  </inputparam>
</characteristic>

<characteristic>
 <inputparam name ="acctform" type = "form"></inputparam>

 <inputparam name = "cmd" type = "inputfield">
   <value>save</value>
 </inputparam>
 <inputparam name = "name" type = "inputfield">
   <value></value>
   <value unique="true">Contact</value>
   <value>Contact</value>
   <value>Contact</value>
   <value>Con,tact</value>
 </inputparam>

 <inputparam name = "state" type = "xml" xmlns="http://xml.avaya.com/rome/via/contact>
   <field name = "type" >
     <fieldvalue>sms</fieldvalue>
   </field>
   <field name = "type" >
     <fieldvalue>sms</fieldvalue>
   </field>
   <field name = "param" node_type="CDATA">
       <fieldvalue>true</fieldvalue>
       <fieldvalue>false</fieldvalue>
   </field>
   <field name = "address" node_type="CDATA">
       <fieldvalue></fieldvalue>
       <fieldvalue>wqxiang2001@gmail.com</fieldvalue>
       <fieldvalue>wqxiang@2001@gmail.com</fieldvalue>
     </field>
   </inputparam>
 </characteristic>

 <characteristic>
  <inputparam name ="acctform" type = "form"></inputparam>

   <inputparam name = "cmd" type = "inputfield">
     <value>save</value>
   </inputparam>
   <inputparam name = "name" type = "inputfield">
     <value></value>
     <value unique="true">Contact</value>
     <value>Contact</value>
     <value>Contact</value>
     <value>Con,tact</value>
   </inputparam>

   <inputparam name = "state" type = "xml" xmlns="http://xml.avaya.com/rome/via/contact>
     <field name = "type" >
       <fieldvalue>voice</fieldvalue>
     </field>
     <field name = "type" >
       <fieldvalue>voice</fieldvalue>
     </field>
     <field name = "address" node_type="CDATA">
         <fieldvalue></fieldvalue>
         <fieldvalue>wqxiang2001@gmail.com</fieldvalue>
         <fieldvalue>wqxiang@2001@gmail.com</fieldvalue>
     </field>
   </inputparam>
 </characteristic>

  <characteristic>
    <inputparam name ="acctform" type = "form"></inputparam>
    <inputparam name = "cmd" type = "inputfield">
      <value>test</value>
      <value>Delete</value>
    </inputparam>
    <inputparam name = "oldname" type = "inputfield">
      <value></value>
      <value>Contact</value>
      <value>Con,tact</value>
    </inputparam>
     <inputparam name = "fullname" type = "inputfield">
      <value></value>
      <value>Contact</value>
      <value>cn=Contact,uid=qwang1,ou=people,dc=research,dc=avayalabs,dc=com</value>
      <value>cn=Conta;ct,uid=qwang1,ou=people,dc=research,dc=avayalabs,dc=com</value>
    </inputparam>
  </characteristic>
</testrequirement>

Figure 2: The test requirement xml file for Points of Contact page

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:4/8/2010
language:English
pages:7
Jun Wang Jun Wang Dr
About Some of Those documents come from internet for research purpose,if you have the copyrights of one of them,tell me by mail vixychina@gmail.com.Thank you!