How to drag an element on the webpage

Ask general questions here.
premravi
Posts: 69
Joined: Tue Jan 08, 2019 1:55 pm

How to drag an element on the webpage

Post by premravi » Fri Apr 12, 2019 10:05 am

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4924
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to drag an element on the webpage

Post by odklizec » Fri Apr 12, 2019 11:42 am

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

premravi
Posts: 69
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to drag an element on the webpage

Post by premravi » Thu Apr 18, 2019 1:09 pm

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
Attachments
drawing canvas.png
drawing canvas.png (49.15 KiB) Viewed 172 times
Canvas-Drawing-Canvas.rxsnp
(144.69 KiB) Downloaded 6 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4924
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to drag an element on the webpage

Post by odklizec » Thu Apr 18, 2019 1:23 pm

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

premravi
Posts: 69
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to drag an element on the webpage

Post by premravi » Thu Apr 18, 2019 4:16 pm

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

qwertzu
Posts: 247
Joined: Wed Jan 25, 2017 11:08 am

Re: How to drag an element on the webpage

Post by qwertzu » Fri Apr 19, 2019 9:15 am

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
ClickActionUpperLeft.png (7.09 KiB) Viewed 151 times
regards, qwertzu

premravi
Posts: 69
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to drag an element on the webpage

Post by premravi » Fri Apr 19, 2019 1:58 pm

Hi,

Thank You for all the inputs you shared

I am able to handle the canvas now

Regards
Ravindra