Docking browser windows

Ranorex Studio, Spy, Recorder, and Driver.
seurrep
Posts: 41
Joined: Tue Aug 07, 2018 10:19 am

Docking browser windows

Post by seurrep » Mon Jan 21, 2019 12:35 pm

I'm currently looking to automate testing of drag and drop functionality when it comes to uploading files. The idea obviously being that you drag a file from explorer and drop it in the specified area on the web page. I've found other threads here that are useful in pointing me in the right direction with regards to the actual drag and drop (using speficied mouse related actions) but there is still one thing I'm not clear on: in order to do this I'll have to have both windows visible so that the file can be dragged from one to the other.

Opening each individual window is easy enough but what I would like to do is dock one of them to the left side of the screen and the other to fill the rest of the space as windows currently seems to allow. Then the dragging ought to be easy. Trying to record it however doesn't seem to provide anything particularly useful. The title bar of window (Edge in this case) is shown as the element being dragged and in both the down and up mouse actions, but the locations listed in the recording don't seem to change between the two despite me dragging the window to the left.

How do I go about setting up the two windows in this way? Does anybody have any pointers?

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

Re: Docking browser windows

Post by odklizec » Mon Jan 21, 2019 12:48 pm

Hi,

I think that docking the window will actually over-complicate the drag&drop operation. It should be possible to perform D&D between windows by using technique, described in this post:
drag-and-drop-files-t10284.html#p41301
- use mouse Move to desired position in window A
- use mouse Down action to init the drag operation
- use EnsureVisible on window B, which should set it on top and active
- use mouse Up action in window B, which should drop the dragged item in window B

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

seurrep
Posts: 41
Joined: Tue Aug 07, 2018 10:19 am

Re: Docking browser windows

Post by seurrep » Mon Jan 21, 2019 1:10 pm

That could well end up helping. Thank you.

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Docking browser windows

Post by McTurtle » Mon Jan 21, 2019 1:53 pm

Hi seurrep,

I would just like to add... If you do need to arrange your windows to occupy each half of the screen, then you can do this by telling Ranorex to focus one window by clicking on it, hold down "LWin", press "Left", release "LWin", click on the 2nd window, hold down "LWin", press "Right" and release "LWin":
ArrangeLeftAndRIghts.png
Regards,
McTurtle
You do not have the required permissions to view the files attached to this post.

ancleg
Posts: 12
Joined: Thu Dec 20, 2018 4:03 pm

Re: Docking browser windows

Post by ancleg » Mon Jan 21, 2019 3:47 pm

You could do each key sequence in one step also, for cleanliness.

Code: Select all

{LWin down}{Left}{LWin up}
and

Code: Select all

{LWin down}{Right}{LWin up}