This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Testing and the fly likes how to select  an image from a list of images using selenium Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "how to select  an image from a list of images using selenium" Watch "how to select  an image from a list of images using selenium" New topic
Author

how to select an image from a list of images using selenium

kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53
I have the following code to display list of images....side by side



I have an option to Reorder the images by drag and drop.
While testing with selenium i need to click an image, drag and drop it to the new position.
I am new to selenium.........please help me how to do this.

I tried to use mouseover with alt for the image that i need to select as you can see in the code above.But its not working.

Thanks in advance.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31054
    
162

I haven't used it, but it looks like the drag and drop object might do what you want.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53
Hey thanks for your help.

I tried using



I can see that the image is dragged and dropped at the specified co-ordinates but other images are not getting reordered.

When i do it manually, i drag an image to right then rest of the images move left arraging themselves and when i drop the image it places itself at the new position.

what i felt was that there must be some wait between the following actions
  • Clicking

  • Dragging
    Dropping
    So i tried like this



    I know this is same as drag and drop with waits but even this was not working.Still i can see only the image is dragged and dropped but no reordering is done.
    Manually it works.

    Thanks in advance.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: how to select an image from a list of images using selenium