Skip to content

Get Table Cell low performance #141

Closed

Description

@mkorpela

_TableElementKeywords._get_table_cell performance is very poor when finding out multiple cell values from the same table. A very basic result caching mechanism improved the situation on my clients test by 30%.

I'm willing to work on a patch to improve the situation on next week.

Activity

  1. Gurud commented on Mar 20, 2013

    @Gurud

    Yes , I m also facing same problem so .. have you go any solution on this? I need it urgently solution on this for my project .. wanted to check sorted records from table.

    Please Send me if you have solution on this - gaurav.sp@gmail.com

  2. ombre42 commented on Mar 20, 2013

    @ombre42
    Contributor

    Get Table Cell is particularly bad with Internet Explorer.
    Two ways to workaround the performance issue is to

    1. Reduce calls by working closely with WebDriver
    2. Use Execute JavaScript
      JavaScript is time-consuming and hard to write (especially in a cross-browser way), but it is definitely the fastest. I don't have an example because I have never gone that route.
      Here's an example showing how to use a Selenium2Library locator and get a collection of WebElements you can work with. Particularly, this logs the text of all the first cells in the keyword table. This is much faster than Get Table Cell, but is definitely ugly.
    *** Settings ***
    Library           Selenium2Library
    
    *** Variables ***
    ${URL}            http://rtomac.github.com/robotframework-selenium2library/doc/Selenium2Library.html
    
    *** Test Cases ***
    Cell Test
        Open Browser    ${URL}    ie
        ${se2lib}=    Get Library Instance    Selenium2Library
        @{cells}=    BuiltIn.Call Method    ${se2lib._element_finder}    find    ${se2lib._current_browser()}    xpath=html/body/table[@class='keywords'][2]/tbody/tr/td[1]
        : FOR    ${webelement}    IN    @{cells}
        \    Log    ${webelement.text}
    
  3. Gurud commented on Mar 24, 2013

    @Gurud

    Thanks Kevin!

    This is not browser specific issue. But I tried according to mentioned code
    for Xpath & made code with Get Text Keyword, it improves a lot & get solved
    issue.

    Thanks a lot,
    Gaurav

    On Wed, Mar 20, 2013 at 11:52 PM, Kevin Ormbrek notifications@github.life-white.ukwrote:

    Get Table Cell is particularly bad with Internet Explorer.
    Two ways to workaround the performance issue is to

    1. Reduce calls by working closely with WebDriver
    2. Use Execute JavaScript
      JavaScript is time-consuming and hard to write (especially in a
      cross-browser way), but it is definitely the fastest. I don't have an
      example because I have never gone that route.
      Here's an example showing how to use a Selenium2Library locator and get a
      collection of WebElements you can work with. Particularly, this logs the
      text of all the first cells in the keyword table. This is much faster than
      Get Table Cell, but is definitely ugly.

    *** Settings ***
    Library Selenium2Library

    *** Variables ***
    ${URL} http://rtomac.github.com/robotframework-selenium2library/doc/Selenium2Library.html

    *** Test Cases ***
    Cell Test
    Open Browser ${URL} ie
    ${se2lib}= Get Library Instance Selenium2Library
    @{cells}= BuiltIn.Call Method ${se2lib._element_finder} find ${se2lib._current_browser()} xpath=html/body/table[@Class='keywords'][2]/tbody/tr/td[1]
    : FOR ${webelement} IN @{cells}
    \ Log ${webelement.text}

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/141#issuecomment-15194037
    .

    ------------------------------
    Warm Regards,
    GAURAV S. DEORE.

  4. aaltat commented on Jun 8, 2016

    @aaltat
    Contributor

    There has not been activity for this issue for long time and we are planning to close the old issues if they are not anymore valid ones. If you feel that this is still valid issue, could you send an update. If update is not received in a month, we will assume that this is not anymore an issues and we will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions