https://bz.apache.org/bugzilla/show_bug.cgi?id=59943

            Bug ID: 59943
           Summary: Problem with Node order using HtmlParsingUtils.getDOM
           Product: JMeter
           Version: 3.0
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTTP
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 34102
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34102&action=edit
Sample HTML response file

Hi

I'm writing a PostProcessor in Java for JMeter - using
HtmlParsingUtils.getDOM() to access the HTML response data.

In this I'm trying to pick out the Form fields from a response so that - when
JMeter submits the form back - I can process the manage setting some of the
posted param data.

My problem is the site I am trying to test returns some slightly wacky HTML,
whereby several (showing one here) input field is included in a <table> element

<input name="1">
<input name="2" />
   <table><tr><td><input name="3"></td>
<input name="4"></tr>  
</table>

When fields get posted back by the browser they send them (form params)
in-order (1+2+3+4) as expected.

However when using HtmlParsingUtils.getDOM() the node tree for the <table>
seems to get included only when the </table> is parsed.

So the tree returned has 3 and 4 swapped
(input 1}
(input 2}
(input 4}
(table
    (tr
      (td
        (input 3}
      )
    )
)


Is this a bug? I confess I'm not sure - it depends if the start tag <table> or
end tag </table> are the trigger for adding, however, from my reading "input 4
is within the table node.

In this I can only assume that "input" fields are handled specially in the
parser (since in html they don't need to include a closing tag or "/>" ? 

What it means for me is that I order I post params from JMeter is affected and
the app dosesn't like this.  You might think that the app should handle params
based on name even in wrong order, but the reality is that the input field
names are not unique on the page - the app is using a framework with we can't
change, 

I have attached an example html file which show this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to