Hi Guys,
I've been through previous threads on Drag n Drop and tried options suggested but no luck
My Final option is to check with Support team.
Below is the code snippet i am using for drag n drop .
Same old Logic of buttonDown,Mouse.MoveTo and ButtonUp
public void RemoveBlockFromDesignCanvas(string blockName)
{
WaitforDesignSpaceResults();
Mouse.Click(FindElementV2_x("RxPathDesignSpaceUpperDesignCanvas"));
ScrollHorizontalOnDesignCanvas();
Mouse.MoveTo(FindElementV2_x("RxPathDesignSpaceDesignCanvasBlockName",blockName));
Mouse.ButtonDown(MouseButtons.Left);
Mouse.MoveTo(FindElementV2_x("RxPathDesignSpaceDesignLabel"));
Mouse.ButtonUp(MouseButtons.Left);
designPageMethods.ClickUpperDesignCanvas();
}
This code is throwing me an exception at Mouse.MoveTo(FindElementV2_x("RxPathDesignSpaceDesignLabel")); as it is unable to find the element, when manually checked through spy i am able to find the element
I am using drag n drop across the application but it is only failing in this method. I am attaching the snapshot for those 2 elements Source(Element) and destination(Element). I have observed that draggable attribute is set to False but i am still able to drag manually
Hope i have provided enough information for you to suggest.
Drag n Drop
Drag n Drop
You do not have the required permissions to view the files attached to this post.
Re: Drag n Drop
Please post the following information when raising issues:
Ranorex version
Windows version
Technology of system under test (Flash/Flex, HTML, Java, WPF, etc.)
Please also post the RanoreXPath you are using for each element. It could be that something that you are using in the path is not correct at the time of the drag-and-drop.
Ranorex version
Windows version
Technology of system under test (Flash/Flex, HTML, Java, WPF, etc.)
Please also post the RanoreXPath you are using for each element. It could be that something that you are using in the path is not correct at the time of the drag-and-drop.
Shortcuts usually aren't...
Re: Drag n Drop
Ranorex version : 5.1.3.19973
Windows version : Windows 8.1
Technology of system under test : JAVA
Source: /dom[@caption='Hubble: Design']//div[#'design_canvas']/div[1]//label[@innertext='billingcity']
Destination : /dom[@caption='Hubble: Design']/body/div[3]/div[2]/div/div[1]/div[2]/div/div[2]/div[2]/div[@innertext='DESIGN']
Note: I am able to drag n drop from other areas onto Design canvas (Source) but cannot drag out from Design canvas to any other area.
just to remind attached snapshot in the main post if that helps.
Windows version : Windows 8.1
Technology of system under test : JAVA
Source: /dom[@caption='Hubble: Design']//div[#'design_canvas']/div[1]//label[@innertext='billingcity']
Destination : /dom[@caption='Hubble: Design']/body/div[3]/div[2]/div/div[1]/div[2]/div/div[2]/div[2]/div[@innertext='DESIGN']
Note: I am able to drag n drop from other areas onto Design canvas (Source) but cannot drag out from Design canvas to any other area.
just to remind attached snapshot in the main post if that helps.
Re: Drag n Drop
Hi,ki2_23 wrote: This code is throwing me an exception at Mouse.MoveTo(FindElementV2_x("RxPathDesignSpaceDesignLabel")); as it is unable to find the element, when manually checked through spy i am able to find the element
Could you please post the exact error you are getting (enable Debug report level)?
Also, I would suggest to add a line of code, that would save the actual state of your app to snapshot (before or after the failing line of code). There is plenty of indexes in the destination path you provided and I guess one of them (or something else in the path) is not valid during the failure?
Another thing you might try is to use this destination path:
Code: Select all
/dom[@caption='Hubble: Design']/body//div[@innertext='DESIGN']
BTW, I suppose this FindElementV2_x is your method? Could you please post the code behind this method?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Drag n Drop
we are not using Ranorex Studio we are coding at API levelodklizec wrote: Could you please post the exact error you are getting (enable Debug report level)?
Error: No element found for path '/dom[@caption='Hubble: Design']/body/div[3]/div[2]/div/div[1]/div[2]/div/div[2]/div[2]/div[@innertext='DESIGN']'.
just to give you an overview this will literally do a tryFindSingle.odklizec wrote:BTW, I suppose this FindElementV2_x is your method? Could you please post the code behind this method?
we have customized to our framework by getting RxPath From DB and apply tryFindSingle to the RxPath and return us Element
Code: Select all
public Element FindElementV2_x(string rxPathName, Duration dur = null, params object[] parameters)
{
if (dur != null)
{
DurationForFindElement = dur;
}
var resolvedPath = RxPathOfTheObjectVersion2_x(rxPathName).Trim();
if (parameters.Any())
{
resolvedPath = String.Format(RxPathOfTheObjectVersion2_x(rxPathName).Trim(), parameters);
}
webDocument.Element.TryFindSingle(resolvedPath, DurationForFindElement, out element);
element = webDocument.Element.FindSingle(resolvedPath);
DurationForFindElement = TimeSpan.FromSeconds(10);
return element;
}
Re: Drag n Drop
Strange this worked but how ?odklizec wrote: Another thing you might try is to use this destination path:Code: Select all
/dom[@caption='Hubble: Design']/body//div[@innertext='DESIGN']
Well the RxPath i am previously using is working at other parts of the code , what is the underlying logic ?
Thanks for the Magic
Re: Drag n Drop
Hi,
OK, this supports my idea that the path is really different during runtime? The question is, why it works somewhere else in your code?
I don't know much about working at API level, but it should still be possible to save the actual application state to snapshot or set the report level to debug? I think the snapshot will show you the difference in destination path. This code should save the DOM to snapshot:
OK, this supports my idea that the path is really different during runtime? The question is, why it works somewhere else in your code?
I don't know much about working at API level, but it should still be possible to save the actual application state to snapshot or set the report level to debug? I think the snapshot will show you the difference in destination path. This code should save the DOM to snapshot:
Code: Select all
Report.Snapshot(ReportLevel.Debug, "User", "", repo.AppDOM.Self);
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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