1. #1
    Ext User
    Join Date
    Mar 2009
    Posts
    2
    Vote Rating
    0
    lyuba2shea is on a distinguished road

      0  

    Default Selenium dragAndDropToObject doesn't move element in ExtJS

    Selenium dragAndDropToObject doesn't move element in ExtJS


    Does anyone experience problems with selenium dragAndDropToObject() method?

    I have two trees like in this example -http://extjs.com/deploy/dev/examples/tree/two-trees.html, have to move an element from one tree to another.


    dragAndDropToObject takes the element to be moved, tries to bring it to another tree and no result - the element comes back to the previous place.


    You can reproduce it using my test:


    @Test
    public void moveElement() throws Exception {
    selenium.start();
    selenium.open("http://extjs.com/deploy/dev/examples/tree/two-trees.html");
    Thread.sleep(1000);
    selenium.dragAndDropToObject("//span[text()='core']", "//span[text()='My Files']");
    Thread.sleep(1000);
    assertTrue(selenium.isElementPresent("//div[@id='tree2']//span[text()='core']"),
    "dragAndDropToObject has not been in progress.");
    }

    I am using Selenium-RC-1.0 beta 2, browser - Mozilla Firefox 3.0.3, OS - Ubuntu 8.04/Windows XP SP2 32 bit

    Looking forward to your replies/advices.

  2. #2
    Ext User
    Join Date
    May 2009
    Posts
    1
    Vote Rating
    0
    garevalo is on a distinguished road

      0  

    Default DragAndDropToObject

    DragAndDropToObject


    Hi, were you able to get the DragAndDropToObject Selenium command to work? both of my xpath targets work when tested with Click command (they are found in the tree) but the DragAndDropToObject command doesn't seem to be working and doesn't show any errors in the log. Any help here greatly appreciated. thanks

    G-

  3. #3
    Ext User
    Join Date
    Mar 2009
    Posts
    2
    Vote Rating
    0
    lyuba2shea is on a distinguished road

      0  

    Default


    Oh no. I am still living with this problem.

  4. #4
    Ext User
    Join Date
    Apr 2008
    Posts
    4
    Vote Rating
    0
    stephaneeybert is on a distinguished road

      0  

    Default Same for me..

    Same for me..


    I too have a drag and drop issue with this dragAndDropToObject method.

    Both of my xpath elements are deemed present just fine with

    selenium.isElementPresent

    like

    selenium.isElementPresent("//div[@id='elearning_question_1220']/span[@class='elearning_question_droppable'][2]/span[@class='elearning_question_answer'][1]/span[@class='elearning_question_answer_field']");

    but the same two paths trigger an element not found from the method

    selenium.dragAndDropToObject("//div[@id='elearning_question_1220']/div/span[@class='elearning_question_answer']/span[@id='elearning_question_1220_3968']", "//div[@id='elearning_question_1220']/span[@class='elearning_question_droppable'][2]/span[@class='elearning_question_answer'][1]/span[@class='elearning_question_answer_field']");

    It is the second path, the droppable one, that is not found.

    Here is the maven error message:

    com.thoughtworks.selenium.SeleniumException: ERROR: Element //div[@id='elearning_question_1220']/span[@class='elearning_question_droppable'][2]/span[@class='elearning_question_answer'][1]/span[@class='elearning_question_answer_field'] not found

    Strange, as it is found a line before by the selenium.isElementPresent method.

    I'm using Selenium maven plugin 1.0-beta-1 in Java on a Linux box.

    Any clue ?

    Cheers,

    Stephane

  5. #5
    Ext User
    Join Date
    May 2010
    Location
    India
    Posts
    3
    Vote Rating
    0
    sheetalj is on a distinguished road

      0  

    Default


    Try mouse events to get this working.Below code is working fine at my side :

    selenium.open("/deploy/dev/examples/tree/two-trees.html");
    selenium.waitForPageToLoad("30000");
    selenium.click("//div[@id='extdd-7']/img[1]"); //Expand tree node
    for (int second = 0;; second++) //Wait for object to get loaded
    {
    if (second >= 60) fail("timeout");
    try { if (selenium.isElementPresent("//div[@id='extdd-49']/a/span")) break; } catch (Exception e) {}
    Thread.sleep(1000);
    }
    selenium.clickAt("//div[@id='extdd-49']/a/span", ""); //Select object to be dragged
    selenium.mouseDownAt("//div[@id='extdd-49']/a/span", "10,30"); //Press left mouse button without releasing it
    selenium.mouseMoveAt("extdd-6", "40,60"); //Press left mouse button without releasing it
    selenium.mouseUpAt("extdd-6", ""); //Release the mouse button on target node

  6. #6
    Ext User
    Join Date
    Apr 2008
    Posts
    4
    Vote Rating
    0
    stephaneeybert is on a distinguished road

      0  

    Default mouseMoveAt

    mouseMoveAt


    Hi,

    Thanks for the tip, but I can't get selenium.mouseMoveAt to work.

    The statement:

    selenium.isElementPresent("//div[@id='elearning_question_1220']/span[@class='elearning_question_droppable'][2]/span[@class='elearning_question_answer'][1]/span[@class='elearning_question_answer_field']");

    works fine and the element is found.

    But this statement:

    selenium.mouseMoveAt("//div[@id='elearning_question_1220']
    /span[@class='elearning_question_droppable'][2]/span[@class='elearning_question_answer'][1]/span[@class='elearning_question_answer_field']", "1, 1");

    fails with the element not being found.

    But these two use the same element path string.

  7. #7
    Ext User
    Join Date
    May 2010
    Location
    India
    Posts
    3
    Vote Rating
    0
    sheetalj is on a distinguished road

      0  

    Default


    try changing the x,y coordinates in mouseMoveAt command which is for target element.

  8. #8
    Ext User
    Join Date
    Apr 2008
    Posts
    4
    Vote Rating
    0
    stephaneeybert is on a distinguished road

      0  

    Default


    I had tried with different alternatives, like "", "1, 1", "0, 0" but I always get the same message:

    com.thoughtworks.selenium.SeleniumException: ERROR: Element //div[@id='elearning_question_1220']/span[@class='elearning_question_droppable'][2]/span[@class='elearning_question_answer'][1]/span[@class='elearning_question_answer_field'] not found

  9. #9
    Ext User
    Join Date
    May 2010
    Location
    India
    Posts
    3
    Vote Rating
    0
    sheetalj is on a distinguished road

      0  

    Default


    Well, i guess you wud might need to try different co-ordinates to make this working.
    Give destination coordinates according to where your target node is from "1,1" position.
    Say, if both source & target are in parallel positions across 2 panels & you have given source position as "1,1" then target coordinates wud be smthing like "6,1";y coordinate won't change.
    It wud be easier to try it in IDE first.Give different coordinates and see where mouse pointer moves.

  10. #10
    Sencha Premium Member
    Join Date
    Jan 2009
    Location
    India
    Posts
    56
    Vote Rating
    0
    nitingautam is on a distinguished road

      0  

    Default


    any luck on this ?
    Knowledge is power share it

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar