Announcement

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

    Functionality of List Grid Panel runs Different at Different Time

    I want to click on the particular column for opening menu to use menu items like(delete , group by , ascending, descending etc).
    When i run my automation code sometime it runs properly, click on the particular menu panel & open up menu bar But sometime it gives error stating that Element is not currently visible and so may not be interacted with.
    Error is posted below & sample screenshot is attached for Understanding.


    ERROR :-
    org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
    Command duration or timeout: 5.07 seconds
    Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
    System info: host: 'laptop', ip: '111.11.111.111', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_66'
    Driver info: org.openqa.selenium.firefox.FirefoxDriver
    Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=44.0.2, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
    Session ID: 00bae0b4-984b-4f6b-805a-376f30198bd2


    For me this is a UI functionality Issue, that same thing works differently at different point of time.

    So can you please let me know what is the best possible way or condition that i can resolve this problem and my automation code runs properly?


    Click image for larger version

Name:	PT smartclient sorting prob1.png
Views:	72
Size:	83.8 KB
ID:	235548



    Click image for larger version

Name:	PT smartclient sorting prob2.png
Views:	73
Size:	106.4 KB
ID:	235547



    Thanks
    Attached Files

    #2
    You haven't provided the exact SmartClient version requested in the posting guidelines
    1. The *complete* SmartGWT or SmartClient version from the lower left-hand corner of the Developer Console (see FAQ for how to open Developer Console), for example, "v10.0p_2015-06-18/PowerEdition Deployment"
    or the automation script you're running - the Selenium HTML script or WebDriver Java code.

    Comment


      #3
      The complete screen shot of the version is attached here and the script which i am running is pasted below.
      Please guide and let me know if you need something else.

      Script:-

      public void arrangeRows() {
      //openMenuBar();

      By assetName = ByScLocator
      .scLocator("//ATListGrid[ID="fundAssetsGrid"]/header/headerButton[title=isc_IButton_19||fieldName=assetNameShort]/");
      driver.click(assetName);

      By assetMenuBar = ByScLocator.scLocator("//ATListGrid[ID="fundAssetsGrid"]/headerMenuButton/");

      WebElement assetMenuBarTable = driver.findElement(assetMenuBar);

      List<WebElement> assetMenuBarTableAllRows = assetMenuBarTable.findElements(By.tagName("tr"));

      outerloop: for (WebElement row : assetMenuBarTableAllRows) {

      List<WebElement> cells = row.findElements(By.tagName("td"));

      for (WebElement cell : cells) {
      System.out.println(cell.getText());
      cell.click();

      By AssetsNameArrangeAssending = ByScLocator
      .scLocator("//Menu[ID="fundAssetsGrid$314"]/body/row[title=Sort%20Ascending||0]"
      + "/col[fieldName=title||1]");
      driver.click(AssetsNameArrangeAssending);
      break outerloop;
      }
      }

      }


      Click image for larger version

Name:	version.png
Views:	76
Size:	81.9 KB
ID:	235560
      Attached Files

      Comment


        #4
        You likely need to add calls to waitForElementClickable(). Read the Using Selenium and then the Automated testing help topics. The second topic has WebDriver code examples using waitForElementClickable().

        Note that it's also likely that you don't really want to click() to reveal the ListGrid menu button, unless you also want to sort by that column. It should be sufficient to do a mouseMove() on the appropriate header button's ByScLocator and then waitForElementClickable() on the ByScLocator for the menu button.
        Last edited by Isomorphic; 4 Mar 2016, 14:56.

        Comment


          #5
          I used waitForElementClickable() & mouseMove() events but still i am not able open Menu and it show same error.
          As per my analysis this happens because the ListGrid menu button behave differently as menu button is not Enable when we try to click. So when we are trying to search panel for click it shows us error of "Element is not currently visible and so may not be interacted with"
          And this you can understand from the two image i attached first.
          In First Image ListGrid Menu Button is not Enable & Present &
          In Second Image their is a seperate list Listgrid Menu Button is Enable & Present.
          So for this Issue we need solution of this problem.


          1st - List Grid Menu Btn is not Present

          Click image for larger version

Name:	1st - Menu Btn is not Present.png
Views:	69
Size:	83.8 KB
ID:	235567



          2nd - List Grid Menu Btn is Present

          Click image for larger version

Name:	2nd - Menu Btn is present.png
Views:	67
Size:	106.4 KB
ID:	235566






          Attached Files

          Comment


            #6
            There's no need to repost those screenshots, but we would like to see the script that you've updated to use waitForElementClickable().

            Comment


              #7
              Ya I shared those screenshots with exact details so you don't have to look back to see those again.
              I tried to put waitForElementClickable() & mousemove() at two different places and both the way i am getting error.
              Yes i am sending you code and it is as follows:-

              1)
              public void arrangeRows() {
              //openMenuBar();

              By assetName = ByScLocator
              .scLocator("//ATListGrid[ID="fundAssetsGrid"]/header/headerButton[title=isc_IButton_19||fieldName=assetNameShort]/");
              driver.click(assetName);

              By assetMenuBar = ByScLocator.scLocator("//ATListGrid[ID="fundAssetsGrid"]/headerMenuButton/");


              WebElement assetMenuBarTable = driver.findElement(assetMenuBar);

              List<WebElement> assetMenuBarTableAllRows = assetMenuBarTable.findElements(By.tagName("tr"));

              outerloop: for (WebElement row : assetMenuBarTableAllRows) {

              List<WebElement> cells = row.findElements(By.tagName("td"));

              for (WebElement cell : cells) {
              driver.waitForElementClickable(assetMenuBar);
              driver.mouseMove(assetMenuBar);
              cell.click();

              By AssetsNameArrangeAssending = ByScLocator
              .scLocator("//Menu[ID="fundAssetsGrid$314"]/body/row[title=Sort%20Ascending||0]"
              + "/col[fieldName=title||1]");
              driver.click(AssetsNameArrangeAssending);
              break outerloop;
              }
              }
              }





              2)

              public void arrangeRows() {
              //openMenuBar();

              By assetName = ByScLocator
              .scLocator("//ATListGrid[ID="fundAssetsGrid"]/header/headerButton[title=isc_IButton_19||fieldName=assetNameShort]/");
              driver.click(assetName);

              By assetMenuBar = ByScLocator.scLocator("//ATListGrid[ID="fundAssetsGrid"]/headerMenuButton/");
              driver.waitForElementClickable(assetMenuBar);
              driver.mouseMove(assetMenuBar);

              WebElement assetMenuBarTable = driver.findElement(assetMenuBar);

              List<WebElement> assetMenuBarTableAllRows = assetMenuBarTable.findElements(By.tagName("tr"));

              outerloop: for (WebElement row : assetMenuBarTableAllRows) {

              List<WebElement> cells = row.findElements(By.tagName("td"));

              for (WebElement cell : cells) {
              cell.click();

              By AssetsNameArrangeAssending = ByScLocator
              .scLocator("//Menu[ID="fundAssetsGrid$314"]/body/row[title=Sort%20Ascending||0]"
              + "/col[fieldName=title||1]");
              driver.click(AssetsNameArrangeAssending);
              break outerloop;
              }
              }
              }

              Comment


                #8
                We really need the complete Selenium log, not just the one error, to determine what widget is involved.

                From the help topics we suggested above, the idea is that you need to add a waitForElementClickable() after every interaction that may lead to a new widget appearing to verify that the widget is ready - so mouseMoving over a header button, clicking on the menu button, etc. Specifically above, the suggestion was to do something like:

                Code:
                By headerButton = ByScLocator.scLocator("//ATListGrid[ID="fundAssetsGrid"]/header/headerButton[title=isc_IButton_19||fieldName=assetNameShort]/");
                driver.mouseMove(headerButton);
                
                By menuButton = ByScLocator.scLocator("//ATListGrid[ID="fundAssetsGrid"]/headerMenuButton/");
                driver.waitForElementClickable(menuButton);
                driver.click(menuButton);
                
                By menu = ByScLocator.scLocator("//Menu[ID="fundAssetsGrid$314"]");
                driver.waitForElementClickable(menu);
                // ... code that interacts with menu
                You may want to double check that your locator for the popup menu is correct (the above was just copied from your code). It would not normally be identified by ID but have a locator based on the parent ListGrid such as "//ATListGrid[ID="fundAssetsGrid"]/headerContextMenu[Class=Menu||index=0||length=1||classIndex=0||classLength=1||roleIndex=0||roleLength=1||scRole=menu]/".

                Note that you're on your own with the code that looks up elements by tagName - that's not a suggested approach in our Selenium help topic.

                Comment


                  #9
                  Note that while the suggested approach above is the correct one, we've also made some changes to the WebDriver code that may affect your situation, so you'll want to update to the latest patch build before posting any logs, if you haven't already done so to resolve the other issues you've posted about. You'll want a nightly build dated 2016-03-07 or later.

                  Comment


                    #10
                    Thanks , I updated the latest version of smart client which is 10.1 and now as i am able to right click on the element to open the menu which resolve my problem , but still i am not able to understand that why App is behaving different at different times .
                    As i tried to explain with the image before that sometimes we are getting different arrow to open Menu and sometime we are not and due to that we are not able to open Menu by just clicking, instead of opening menu its just ordering rows in to Ascending/ Descending.
                    So right now my problem is solved but still we need to dig in to find this solution.

                    Comment

                    Working...
                    X