Hi Guys,
I am trying to read the task list dynamically using renorex but i am just getting the first Task as calc getting capured via my script. Not able to capture the list of task and print them using renorex from Task manager window. Please help me . This is bit urgent for me.
Thanks,
Shahnawaz
How to read & Print list of Tasks in Task manager window
-
- Posts: 4
- Joined: Tue Aug 02, 2016 9:29 am
Re: How to read & Print list of Tasks in Task manager window
Hi Shanawaz,
I would use the following code snippet in order to achieve your intention.
I hope this helps.
Kind regards,
asdf
I would use the following code snippet in order to achieve your intention.
Code: Select all
var list = Host.Local.Find<Row>("/form[@name='Task Manager']//container[@automationid='processestab_tables']/table[@automationid='cpuList']/row");
foreach(var item in list)
{
string proc = item.Element.GetAttributeValueText("Name");
Report.Info(proc);
}
Kind regards,
asdf
Re: How to read & Print list of Tasks in Task manager window
Hi,
If you don't care about app groups, in which the individual process are grouped (Apps, Background and Windows processes), below xpath returns all available processes as treetiems, where each treeitem represent one running process. To get the name of process use either Text or Name attribute.
Just create a new repo item with below xpath:
Then use code like this, to loop though all found treeitems and read Text/Name attribute to get the name of each running process...
Hope this helps?
PS: I was not notified there is already a reply in this post, anyway, now you have two similar solutions (with and without repo)
If you don't care about app groups, in which the individual process are grouped (Apps, Background and Windows processes), below xpath returns all available processes as treetiems, where each treeitem represent one running process. To get the name of process use either Text or Name attribute.
Just create a new repo item with below xpath:
Code: Select all
/form[@name='Task Manager']/container/container/container[@automationid='apptab_tables']/container/table/container/treeitem
Code: Select all
// Create a list of adapters using the "Info" object
IList<Ranorex.TreeItem> treeItemList =
repo.TaskManagerTreeInfo.CreateAdapters<Ranorex.TreeItem>();
// get name of each process and display it in report
foreach (Ranorex.TreeItem treeItemElement in treeItemList )
{
string processNameString= treeItemElement.Text;
Report.Info("process Name: " + processNameString);
}
Hope this helps?
PS: I was not notified there is already a reply in this post, anyway, now you have two similar solutions (with and without repo)
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
-
- Posts: 4
- Joined: Tue Aug 02, 2016 9:29 am
Re: How to read & Print list of Tasks in Task manager window
Thanks you so much!! I got it now and able to publish the list of Task (count & String) using the code provided by " Asdf" . I am new to Renorex and working on Critical Project POC. if successful , we will be procuring liences.
I also want to know how I can determine the Name of the task under " Application tab of the the task manager" window, Runtime. I mean to say if I open and close an application calc and the sequence of the listing of the application changes, how to determine that or capture this event runtime ?
Please help me.
With Regards,
Shahnawaz
I also want to know how I can determine the Name of the task under " Application tab of the the task manager" window, Runtime. I mean to say if I open and close an application calc and the sequence of the listing of the application changes, how to determine that or capture this event runtime ?
Please help me.
With Regards,
Shahnawaz
Re: How to read & Print list of Tasks in Task manager window
Hi shahnawaz,
Since Ranorex is based on SharpDevelop, you can use the whole C# functionality in order to accomplish your intention.
Hopefully, the following links will help you.
How to handle Popups
EventHandler
Sincerely,
asdf
Since Ranorex is based on SharpDevelop, you can use the whole C# functionality in order to accomplish your intention.
Hopefully, the following links will help you.
How to handle Popups
EventHandler
Sincerely,
asdf