Menu

#1903 Incorrect behaviour for DomElement.click() method

2.27
pending
RBRi
None
1
2017-12-25
2017-07-18
Anton
No

Hi,

Since v2.25 behaviour for DomElement.click() method has been changed and now it is different in comparsion with real browsers. Seems that there is extra visibility check which is not required.

Please find the patch with test for exposing this problem and removing extra validation.

1 Attachments

Discussion

  • Ahmed Ashour

    Ahmed Ashour - 2017-07-18
    • status: open --> accepted
     
  • Ahmed Ashour

    Ahmed Ashour - 2017-07-18

    Test cases added in SVN.

    The only change:

    assertEquals(URL, URL) instead of (String, URL)

     
  • Anton

    Anton - 2017-12-19

    Any updates on this issue?

     
  • RBRi

    RBRi - 2017-12-19
    • status: accepted --> pending
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2017-12-19

    Hi Anton,
    sorry for comming back that late to this issue. Have done some debugging and it looks like a bug in the HtmlUnit Driver. Do you use the driver or pure HtmlUnit?

     
  • Anton

    Anton - 2017-12-20

    Thanks for a response, I will double check it and provide more details later

     
  • RBRi

    RBRi - 2017-12-20

    looks like we have some more problem here. Working on more test cases at the moment and will fix it after that.

     
    • Anton

      Anton - 2018-01-11

      Thanks

       
    • Anton

      Anton - 2018-02-15

      Do you need help with investigation or additional tests writing?

       
  • Atsushi Nakagawa

    Thanks RBRi. I think the fixes for #1939 are definitely improvements and solves the problem for Javascript, but what about DomElement.click() which still has visibility check?

    Should these two lines of code behave differently? First still has visibility check as at trunk @ r15041 while second doesn't.

    p.<HtmlElement>getFirstByXPath("//area[@id='a1']").click();
    
    p.executeJavaScript("document.getElementById('a1').click()");
    

    Personally, I think visibility check at this layer makes HtmlUnit difficult to use, and feels kind of superflous because application code is already at a stage where it's decided it wants to click it, regardless of (or despite of) visibility.

     

    Last edit: Atsushi Nakagawa 2017-12-25

Log in to post a comment.