Hi,
I hope you can help me on my issue as I have 2 objects (container) which could be selected depending on the logic of which container you want to select.
So I added and created a repository that I can call during runtime.
However, during the first execution, I am calling the first text and it is working fine. But for the second text, it is still selecting the first text.
repo.MoveletStep=strMoveletStep;
repo.Movilizer.ClientMainObjects.txtMoveletStep.Element.Focus();
string strActualMoveletStep = repo.Movilizer.ClientMainObjects.txtMoveletStep.Element.GetAttributeValueText("text");
Report.Info(strActualMoveletStep);
Report.Screenshot();
if (strActualMoveletStep == strMoveletStep)
{
repo.Movilizer.ClientMainObjects.txtMoveletStep.Focus();
Delay.Seconds(1);
repo.Movilizer.ClientMainObjects.txtMoveletStep.Click();
Report.Success("Clicked on Movelet step: "+strMoveletStep);
}
Do you have an idea on this?
Thank you so much.
Best regards,
Jill
Convert Ranorex Path to String and update the path in runtime
Convert Ranorex Path to String and update the path in runtime
You do not have the required permissions to view the files attached to this post.
Re: Convert Ranorex Path to String and update the path in runtime
I usually use repository items that have repository variables embedded within the RxPath. I then adjust the variable at runtime, which customises the repoitem. e.g. I might specify a list element as "listitem[@text=$NamedItem]" and then adjust "Repo.NamedItem = "Some Named Item";" in my code. Is that what you mean?
Re: Convert Ranorex Path to String and update the path in runtime
Hi Jill,
Could you please upload a Ranorex snapshot (NOT screenshot) of the UI? Additionally, I think you should stop relying on element indexes, which are highly volatile and could easily break your tests. My best guess, without seeing the snapshot and complete xpaths behind the elements used in code, is that an xpath returns multiple elements and not just one? In this case, Ranorex always picks the first found element, which could be also your case? So please post the snapshot and xpaths (not screenshots of xpaths) so we can analyze them.
Maybe I'm missing something obvious, but why don't you create an xpath, based of the Text attribute, which is containing text 'Order long text' or 'Leave order processing?
Could you please upload a Ranorex snapshot (NOT screenshot) of the UI? Additionally, I think you should stop relying on element indexes, which are highly volatile and could easily break your tests. My best guess, without seeing the snapshot and complete xpaths behind the elements used in code, is that an xpath returns multiple elements and not just one? In this case, Ranorex always picks the first found element, which could be also your case? So please post the snapshot and xpaths (not screenshots of xpaths) so we can analyze them.
Maybe I'm missing something obvious, but why don't you create an xpath, based of the Text attribute, which is containing text 'Order long text' or 'Leave order processing?
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