vendredi 22 juin 2018

how to extract specified values from a table with selenium based on a string condition

I have a table which has a column which contains: - a list of invoices - a column which contains a lots of charge types for every invoice displayed

What I want to do is to make a function which receives a String parameter,for example the invoice number and return all the charge types for invoice number inserted Here is the code for the table

Every time a new invoice is displayed on the table,the first line of the table contains and a value

That value represents the number of the charge types displayed on every invoice

For example the charge types are :Management fee,Payments,Funds Transmission Cost,Acquiring Authorisation Fee,Service etc.

<form method="post" action="/accounting/billing/showInvoiceTransactionsCountTotal.html? 
    jlbz=lfISHfhqWHPj5fSzCwFKoP8c5ukwXecQt0fr4iL6ak" target="detail">
   <table>
      <tbody>
         <tr>
         <tr class="odd">
            <td rowspan="8">
               <a href="/accounting/billing/showInvoice.html?invoiceNumber=BA7123399&jlbz=lfISHfhqWHPj5fSzCwFKoP8c5ukwXecQt0fr4iL6ak">
                                        BA7123399                                             
                  <input type="hidden" value="BA7123399" name="invoiceChecked"/>
               </a>
            </td>
            <td>Management fee (captured transactions)</td>
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>2</td>
        </tr>
        <tr class="odd">
            <td>Payments</td>
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>2</td>
        </tr>
        <tr class="odd">
            <td>Funds Transmission Cost (FTC)</td>
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>1</td>
        </tr>
        <tr class="odd">
            <td>Acquiring Authorisation Fees</td> 
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>2</td>
        </tr>
        <tr class="odd">
            <td>Service</td>
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>2</td>
        </tr>
        <tr class="odd">
            <td>Refunds</td>
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>1</td>
        </tr>
        <tr class="odd">
            <td>Chargebacks</td>
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>1</td>
        </tr>
        <tr class="odd">
            <td>Minimum Billing</td>
            <td>PAYPALC001M2</td>
            <td>PAYPALC001A1</td>
            <td>2</td>
        </tr>
        <tr class="even">
            <td rowspan="4">
                <a href="/accounting/billing/showInvoice.html?invoiceNumber=BA7123421&jlbz=lfISHfhqWHPj5fSzCwFKoP8c5ukwXecQt0fr4iL6ak">
                                        BA7123421                                             
                   <input type="hidden" value="BA7123421" name="invoiceChecked"/>
                </a>
           </td>
           <td>Payments</td>
           <td>ALEXAUTOMATION01</td>
           <td>ALEXADCODE</td>
           <td>1</td>
        </tr>
        <tr class="even">
        <tr class="even">
        <tr class="even">
        <tr class="odd">
           <td rowspan="8">
               <a href="/accounting/billing/showInvoice.html?invoiceNumber=BA7123398&jlbz=lfISHfhqWHPj5fSzCwFKoP8c5ukwXecQt0fr4iL6ak">
                                        BA7123398                                             
                   <input type="hidden" value="BA7123398" name="invoiceChecked"/>
               </a>
           </td>
           <td>Management fee (captured transactions)</td> 
           <td>PAYPALC001M2</td>
           <td>PAYPALC001A1</td>
           <td>1</td>
        </tr>
        <tr class="odd">
        <tr class="odd">
        <tr class="odd">
        <tr class="odd">
        <tr class="odd">
        <tr class="odd">
        <tr class="odd">
        <tr class="even">
            <td rowspan="10">
                <a href="/accounting/billing/showInvoice.html?invoiceNumber=BA7123397&jlbz=lfISHfhqWHPj5fSzCwFKoP8c5ukwXecQt0fr4iL6ak">
                                        BA7123397                                             
                   <input type="hidden" value="BA7123397" name="invoiceChecked"/>
                </a>
           </td> 
           <td>Management fee (captured transactions)</td>
           <td>PAYPALC001M2</td>
           <td>PAYPALC001A1</td>
           <td>2</td>
        </tr>
        <tr class="even">
        <tr class="even">
        <tr class="even">
        <tr class="even">
        <tr class="even">
        <tr class="even">
        <tr class="even">
        <tr class="even">
        <tr class="even">
  </tbody>

Aucun commentaire:

Enregistrer un commentaire