Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Selenium problem in nagivation tree

    During playback, selenium only click the tree node but not do the selection.

    problem 1:
    For reproducing this problem, go to
    Code:
    http://www.smartclient.com/docs/7.0rc2/a/system/reference/SmartClient_Explorer.html#_Trees_Sorting
    Recod follow steps.
    1.click the first level tree node -- "charles madigen"
    2.click the second level tree node --"ralph brogan"
    3.click the forth level tree node --"besty rosent"
    Code:
    selenium.open("http://www.smartclient.com/docs/7.0rc2/a/system/reference/SmartClient_Explorer.html#_Trees_Sorting");
    selenium.click("scLocator=//TreeGrid[ID=\"employeeTree\"]/body/row0/col0");
    selenium.click("scLocator=//TreeGrid[ID=\"employeeTree\"]/body/row1/col0");
    selenium.click("scLocator=//TreeGrid[ID=\"employeeTree\"]/body/row3/col0");
    during the playback, you will find that when selenium do the first click, instead of selecting the first tree node, selenium click the open icon to collspse the whole tree and the first tree node is not high light. "Element is not found" will be shown when selenium do the second click, that is because the whole tree is collapsed.

    problem 2:

    using the selenium record from problem 1, playback in IE. When selenium doing the first click,you will see error that element is not found. However, if you increase the row index by 1, you will get the same issue in problem 1.So in IE, tree node index starts from 1, but in firefox, tree node index starts from 0.

    #2
    What you're most likely seeing is that there is a double click occurring, which opens the folder and hence changes the tree. To avoid this, space out the clicks.

    Comment


      #3
      Each click clicks on different node, there is no double click. even though if i only do one click, the tree will be callapsed.
      Last edited by kevincy; 21 May 2010, 10:27.

      Comment


        #4
        have you tried to reproduce the problem with the steps i provided?
        thanks.

        Comment


          #5
          We'll look into it however let us reiterate that Selenium is supported only for SmartClient 8.0 so when providing a testcase you need to verify the issue exists against the 8.0 build which can be found here.

          Comment


            #6
            I tried the latest 8.0 build, problem still exist.

            Comment


              #7
              this is urgent for us, please take a look into it.

              Comment


                #8
                Originally posted by kevincy
                Code:
                http://www.smartclient.com/docs/7.0rc2/a/system/reference/SmartClient_Explorer.html#_Trees_Sorting
                Recod follow steps.
                1.click the first level tree node -- "charles madigen"
                2.click the second level tree node --"ralph brogan"
                3.click the forth level tree node --"besty rosent"
                Code:
                selenium.open("http://www.smartclient.com/docs/7.0rc2/a/system/reference/SmartClient_Explorer.html#_Trees_Sorting");
                selenium.click("scLocator=//TreeGrid[ID=\"employeeTree\"]/body/row0/col0");
                selenium.click("scLocator=//TreeGrid[ID=\"employeeTree\"]/body/row1/col0");
                selenium.click("scLocator=//TreeGrid[ID=\"employeeTree\"]/body/row3/col0");
                during the playback, you will find that when selenium do the first click, instead of selecting the first tree node, selenium click the open icon to collspse the whole tree and the first tree node is not high light. "Element is not found" will be shown when selenium do the second click, that is because the whole tree is collapsed.
                Can you elaborate on the states of these nodes that you describe in steps 1,2 and 3 and the expected results? In the sample the Tree with root "charles madigen" is fully expanded so a click on it would make it collapsed and when the tree is collapsed at the root, the node "ralph brogan" is not visible.

                Similarly if you are starting out with the root collapsed, a click on the node would expand it and a click on "ralph brogan" would collapse this node so its not clear how you can get to step 3 of clicking "besty rosent".

                Also realize that a click does not expand the node instantaneously so having two click commands sequentially might not result in the desired outcome. You'll need to add add a "pause" command of appropriate duration.

                Comment


                  #9
                  since at the beginning all the tree nodes are expended, the expect result for step 1,2,3 is only doing the selection on the tree node.
                  For all the expandable tree node in your sample, they will be collapsed or expended only if we double click them or click the open icon. Single click will only do the selection but nothing else.

                  thanks

                  Comment


                    #10
                    The locator String you're showing (scLocator=//TreeGrid[ID=\"employeeTree\"]/body/row0/col0") appears to be either hand-created or from a version of SmartClient before Selenium was added. Be sure to use only locators from 8.0.

                    Regardless, there is a problem here where clicks recorded against the first column can trigger expand/collapse and we're putting together a fix. One way avoid the problem is to click in any other column (if there's more than one).

                    Comment


                      #11
                      OK.By adding some ugly hack, i am having one more column in my tree. and the trigger expand/collapse problem is temporary fixe.

                      When do you estimate you will fix this problem? Because tree is very import in our product.

                      Comment


                        #12
                        Found another problem about tree related to selenium.
                        Code:
                        1.selenium.click("scLocator=//TreeGrid[ID=\"page$content$$content$tree\"]/body/row[0]/col[0]/open");
                          selenium.pause("2000");
                        2.selenium.click("scLocator=//TreeGrid[ID=\"page$content$$content$tree\"]/body/row[0]/col[0]");
                          selenium.pause("2000");
                        3.selenium.click("scLocator=//TreeGrid[ID=\"page$content$$content$tree\"]/body/row[1]/col[0]");
                        //I removed the ID and label in row[].
                        The above commands generate very strange result.
                        The expecting result will be step 1 expands my tree and step 2 collapses the tree and step 3 gives us error since it will click on a node which is collapsed.
                        But the actual result is that step 1 expands the tree,step 2 does nothing and step 3 collapse the tree. So it seems that the index of the rows restart from 1 once the tree is expended.
                        Last edited by kevincy; 27 May 2010, 13:29.

                        Comment


                          #13
                          Hi
                          We have someone looking at the issue whereby a recorded single click in the 'tree field' always toggles the open / closed state of the folder in selenium, even if the click didn't occur over the open / close icon.
                          We expect to have a fix for this in the 8.0 branch this week.

                          On the new issue, the expected behavior isn't as you describe -- what would be expected if everything were working properly is:

                          step 1 -- replays a click in the open area - causes the tree to expand (assuming it was previously collapsed)

                          step 2 -- replays a click on the first record in the grid but not in the "open area". This should not cause the grid to collapse, it should just cause the first record to be selected / clicked.

                          step 3 -- should select the second row in the grid.


                          The bug we've been discussing in this thread is essentially that step 2 would be causing the data to collapse.
                          Is it possible that this is actually what you're seeing?

                          The observed behavior you're describing would be quite unexpected - once you pull all the fallback identifiers out of the locator string and leave just the crude rowNum the system will indeed use that rowNum to identify the row to interact with -- the system won't restart the numbering as 1-based rather than zero-based or anything.
                          Regardless we'll pass this onto the dev team and verify your test case works as we describe above once the bug we've been discussing is resolved.

                          Comment


                            #14
                            thanks for the reply

                            step 2 -- replays a click on the first record in the grid but not in the "open area". This should not cause the grid to collapse, it should just cause the first record to be selected / clicked.
                            In my example, there is only one column in the tree, so the tree should be collapsed because of the bug we are having. And I should see the error.
                            But, I did not see any error, and the tree is collapsed by step 3, even if i only execute step 1 and 3, the tree will still be collapsed by step 3.

                            I jusr tried not user row number but label, but still get the same result.
                            Following is the command i used.
                            Code:
                            selenium.click("scLocator=//TreeGrid[ID=\"page$content$$content$tree\"]/body/row[label=String%20Doc||1]/col[fieldName=label||0]");
                            I guess in your selenium user-extension, you use label to search for the row index, and click on the corresponding row. But since row index will restart from 1 after tree is expended, there is no difference use label or row number in the command.
                            Last edited by kevincy; 27 May 2010, 14:32.

                            Comment


                              #15
                              hi, i tried the may 28 build. the new issue does not happen.

                              so only thing left for tree is the bug you are fixing.

                              could you please let me know when you fixed this bug?

                              thanks.

                              Comment

                              Working...
                              X