My Code launches the application but doesn't input text and throws error "The element does not support the required capability 'control'. ";void ITestModule.Run()
{
Host.Local.RunApplication(@"C:\org\application\NETComponents\random.exe");
Ranorex.Delay.Milliseconds(10000);
Ranorex.Control ctrl = Ranorex.Control.FromPath("/form[@controlname='Flash' or @domain='localhost']//flexobject[@movie='C:\\org\\web\\webapps\\abc.swf']");
Ranorex.Text t = ctrl.FindSingle("?/?/text[@id='userInput']");
t.TextValue.Equals("inputvalue");
}
Desktop application error
Desktop application error
I am trying to convert recording (Please see screenshot) into below mentioned code module
- Attachments
-
- Recording.PNG (17.75 KiB) Viewed 594 times
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Desktop application error
Hi,
Please use the following code instead:
Robin
You can't cast a flex object to a Ranorex.Control.Ranorex.Control ctrl = Ranorex.Control.FromPath("/form[@controlname='Flash' or @domain='localhost']//flexobject[@movie='C:\\org\\web\\webapps\\abc.swf']");
Please use the following code instead:
Ranorex.FlexObject ctrl = Ranorex.Control.FromPath("/form[@controlname='Flash' or @domain='localhost']//flexobject[@movie='C:\\org\\web\\webapps\\abc.swf']");Cheers,
Robin

Re: Desktop application error
Hi RobinHood42
Sorry to say, but this is not working for me. It throws exception "Explicitly Ranorex.Control can't cast to Ranorex.Flexobject" so I just changed this line
to Ranorex.FlexObject ctrl =Ranorex.FlexObject.FromPath("same rxpath thing here");
I found an article provided by Ranorex but did not make any sense to me. https://www.ranorex.com/help/latest/int ... pplication. Please go through this if it makes sense to you.
I believe there is some problem in /form[@controlname='Flash' or @domain='localhost'] and //flexobject[@movie='C:\\org\\web\\webapps\\abc.swf']
I think I need to place these files somewhere else according to the article provided by Ranorex. .
Sorry to say, but this is not working for me. It throws exception "Explicitly Ranorex.Control can't cast to Ranorex.Flexobject" so I just changed this line
to Ranorex.FlexObject ctrl =Ranorex.FlexObject.FromPath("same rxpath thing here");
I found an article provided by Ranorex but did not make any sense to me. https://www.ranorex.com/help/latest/int ... pplication. Please go through this if it makes sense to you.
I believe there is some problem in /form[@controlname='Flash' or @domain='localhost'] and //flexobject[@movie='C:\\org\\web\\webapps\\abc.swf']
I think I need to place these files somewhere else according to the article provided by Ranorex. .
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Desktop application error
Hi,
I would recommend to simply track the wanted element with Ranorex Spy. Afterwards, simply drag/drop the element to your Ranorex Studio CodeModule. The code to the element gets auto-created.
Cheers,
Robin
I would recommend to simply track the wanted element with Ranorex Spy. Afterwards, simply drag/drop the element to your Ranorex Studio CodeModule. The code to the element gets auto-created.
Cheers,
Robin