Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: TreeGrid

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    7

    Cool TreeGrid

    Hi
    I am having a really hard time getting selenium to see my applications treegrid. I have the script working on the upper buttons no problem via xpath. I have downloaded xpather and dom inspector to try to capture the xpath or class. However with me capturing this and running it - its still not working and I am now at a loss as to what I am doing wrong. I am trying to select a row and then right click on a menu to insert a category (which in turn inserts a row). I cant get the treegrid selection working and the Selenium IDE doesnt recognize the right mouse click off the row. Does anyone have any ideas?

    Heres the xpath code I pulled from my row select which should be fired via click method that doesnt work -
    "xpath=//html/body/div[@id='x-auto-47']/div[@id='x-auto-52']/div[2]/div[1]/div/div/div[1]/div[@id='x-auto-174']/div[2]/div[@id='x-auto-175']/div[@id='x-auto-180']/div[@id='Budget View_Budget View']/div[1]/div[1]/div[2]/div[1]/div[@id='Budget View_Budget View_x-auto-508']/table/tbody/tr/td[@id='x-auto-501']"
    Tx!

  2. #2

    Default Cant Invoke Mouse events on TreeGrid with Selenium... Any help??

    We are using TreeGid component and are unable to handle Mouse clicks on TreeGrid fields. The Xpaths and DOM representations of elements fail to do any magic.

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    7

    Default Frustrated with TreeGrid

    Yes I have tried all mouse down & click all - I've gone through all of safari books and the web....I'm out of ideas - its not often I think something can't be done but unless someone who has done it answers this thread I am starting to think that.....I've used xpather with DOM inspector I have all examples working but the software with this treegrid is not. I'm feeling frustrated.

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    7

    Default Solution to TreeGrid

    Hey I got it working in the end I switched out my constructor for WebDriverBackedSelenium and it worked! Its great let me know if I can help you in anyway.

  5. #5

    Thumbs up

    Woww.. thats really great to hear. I have infact tried to automate the click event on the TreeGrid examples site too. but failed to do that.

    Could you please give me some pointer of how you could manage to get the clicks working for any TreeGrid control.
    Some example or the code that you used shall be greatly helpful.

    That should help us to start something at least...

    Ref URL:
    http://www.tgantt.com/treegrid/www/G...nttSimple.html

    I have also tried something in the downloaded examples but failed there too

    What I typically tried was:
    Took various DOM / XPath representations of the elements and then identified them using "Find" button of Sel IDE
    Then tried to execute the selenium.Click command and failed.

    I tried using HTML Unit Driver and Frirefox drivers but was geting below issue:
    Testcase: treeGridExampleTest(nl.fortes.selenium.tests.FunctionalTests.TreeGridExampleTest): Caused an ERROR
    Unable to locate element: {"method":"class name","selector":"GroupHeaderTitleSpan"}
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.0rc3', revision: '12536', time: '2011-06-20 18:19:52'
    System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_23'
    Driver info: driver.version: RemoteWebDriver
    org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"GroupHeaderTitleSpan"}
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.0rc3', revision: '12536', time: '2011-06-20 18:19:52'
    System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_23'
    Driver info: driver.version: RemoteWebDriver


    Thanks in advance for your help

    Br,
    Krishnam

  6. #6
    Sencha User
    Join Date
    Aug 2011
    Posts
    7

    Default Setup

    I had a number of things setup first before running the examples. These were : the add on selenium IDE through Firefox, DOM inspector add on through Firefox. After this I installed the XPather add on to the DOM inspector. I used the DOM inspector once I had fired off a run through Eclipse initially on the actually app as this needs to compile and then with a JUnit test. This would open up the browser window with my app inside. I then opened a new window in Firefox with a copy of the url and then opened up the DOM from this particular browser window menu. You can then go to the menu in the DOM and select Edit->Select by element. To capture the row itself I grabbed the writing in the row - in my case there was a fixed row label. Then go to the browser window you opened the DOM on and select an element. It should flash red. This means the inspector has caught the element. You should see an XPATH field at the top of the inspector - this was XPather you installed. Grab this code copy it and paste it into a click in your junit.

    Bare bones junit test I used - SeleneseTestCase was deprecated so there was a cross through this. (I have to tidy up this bit but will later).

    public class BudgetingTest extends SeleneseTestCase{
    public WebDriverBackedSelenium selenium;

    public void setUp() throws Exception {

    WebDriver driver = new FirefoxDriver();
    selenium = new WebDriverBackedSelenium(driver, "http://localhost:1234");
    }

    public void testUntitled() throws Exception {

    selenium.open("/GWTBudgeting.html");


    selenium.click("xpath=//html/body/div[@id='x-auto-47']/div[@id='x-auto-52']/div[2]/div[1]/div/div/div[1]/div[@id='x-auto-174']/div[2]/div[@id='x-auto-175']/div[@id='x-auto-180']/div[@id='Budget View_Budget View']/div[1]/div[1]/div[2]/div/div[@id='Budget View_Budget View_x-auto-476']/table/tbody/tr/td[@id='x-auto-464']/div/b");

    }

    }

    Now onto getting the context menu to work on right mouse click .......

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Posts
    7

    Default Task 4 on Gantt

    Try this xpath code for selection of Task 4 row field on the gantt chart.

    /html/body/table/tbody/tr/td[2]/div[@id='BodyScroll']/div[@id='Body']/div/div/div/div/table[@id='GanttSimple']/tbody/tr[2]/td[1]/div/div[2]/table/tbody/tr[8]/td[4]

  8. #8

    Default

    Thanks a ton for your time and help. It is unfortunate that we are still not able to manage to get the clicks registered for our TreeGrid component. I am still seeing the same exception as reported above

    However, Thanks again for all your time and help extended

    Br,
    Krishnam

  9. #9
    Sencha User
    Join Date
    Aug 2011
    Posts
    7

    Default Too many instances open firefox

    I was getting the same error as you yesterday at one point. It seemed because I had too many selenium generated firefox windows open. I shut these down did a clean and auto build was switched on and reran and it worked. Just a thought.

  10. #10

    Default TreeGrid Saga continues

    Hi Eq1,

    By using SeleniumBackedWebDriver, I am able to click on the COQSoft example elements but the same seems to fail on our application.
    I am able to identify the element correctly using the SIDE "Find" button but the selenium.click and selenium.type functions never work

    However, Using the same Xpath, I am able to read the contents of the fields. From the attached image, I am trying to change the value of Edited to NewValue but that does not seem to work. However, I can always read the value of that field and echo the same.

    Can you pls help?
    Attached Images Attached Images

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •