Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
kalyen kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used it, but it looks like the drag and drop object might do what you want.
 
kalyen kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic