Page 1 of 1
How to drag an element on the webpage
Posted: Fri Apr 12, 2019 10:05 am
by premravi
Hi,
Please help me to understand, how can I drag an element
The requirement is, there is an image located at the center of the webpage to which I have to drag and increase the size of the image
Please note I don't have to drop the image anywhere, just have to drag (increase) it.
Regards
Re: How to drag an element on the webpage
Posted: Fri Apr 12, 2019 11:42 am
by odklizec
Hi,
I'm afraid, that without seeing the page and image in question, there is not much anyone here can do or suggest. As long as the image could be resized by simple mouse drag, you should be able to achieve what you want by simple Mouse Down >> Mouse Move >> Mouse Up sequence. In other words, there is no such a thing like "single action" mouse drag. Hope this helps?
Re: How to drag an element on the webpage
Posted: Thu Apr 18, 2019 1:09 pm
by premravi
Hi
Sure, I am attaching the snapshot of the application
I am not sure if (Mouse Down >> Mouse Move >> Mouse Up sequence) helps because that area of web page is a drawing canvas and no elements to exactly identify the graph edges which will help us to increase the size of the graph using Mouse operations
Please find the attached screenshot and the snapshot as requested
NOTE : In the screenshot attached you will see a graph in centre, thats our target area which we have to increase
Regards
Re: How to drag an element on the webpage
Posted: Thu Apr 18, 2019 1:23 pm
by odklizec
Hi,
The canvas area seems does not represent the actual chart rectangle? In my opinion, below xpath points to the chart rectangle:
/dom[@domain='dashboard.eu-iport.nielsen-iwatch.com.aws-w-np.nielsencsp.com']/body[@class='background-cover']/?/?/div[@class='home-page-container']/div[@class='home-page-view']/div[@class='viewport-container']/?/?/div[@class='widgets']/?/?/div[@class='iport-chart-plugin-container']/?/?/div[@class='chart-container']/?/?/table[@class='tblChart']//div[@class='chartContainer']
Unfortunately, without seeing the actual app and examining the way the chart is resized, it's hard to say what are your options. However, dragging steps, as I mentioned them in my post, are currently the only way, how to drag something using the mouse actions in Ranorex.
Re: How to drag an element on the webpage
Posted: Thu Apr 18, 2019 4:16 pm
by premravi
Hi
Thanks a lot for the xPath,
I am able to exactly identify the graph area now ,
But as you know I have to increase the size of the graph
I read your comment I can understand its difficult to suggest any other option and that's fine, I will go with mouse operations
But first I have to place my cursur to a edge (boundary) of the graph from where I can use my mouse operation
Please help me to understand how can I place my cursur to the edge of the graph so from there I can use mouse operations and start resizing it
Regards
Re: How to drag an element on the webpage
Posted: Fri Apr 19, 2019 9:15 am
by qwertzu
hey,
you could use relative coordinates in your click action.
For example the coordinates .0;.0 on the element suggested by Odklizec will move the mouse to the upper left corner of the element.
ClickActionUpperLeft.png
regards, qwertzu
Re: How to drag an element on the webpage
Posted: Fri Apr 19, 2019 1:58 pm
by premravi
Hi,
Thank You for all the inputs you shared
I am able to handle the canvas now
Regards
Ravindra