Host.Local.Find() cannot get the form, a strange issue??
Host.Local.Find() cannot get the form, a strange issue??
Environment: XP
Steps:
1. Create a project A to uninstall an application at Control Panel->Add or Remove Programs.
the Rxpath of the form is "/form[@processname='IKernel' and @class='#32770' and @visible='true' and @enabled='true' and @valid='true']".
Ranorex.Form f=Host.Local.Find(New Rxpath("/form[@processname='IKernel' and @class='#32770' and @visible='true' and @enabled='true' and @valid='true']"))
2. finish functions and Compile this project
3. Create Another porject B , through reference to load in project A.
Invoke functions in Project A.
the program will hold for a long time,maybe 2~4 hour at Ranorex.Form f=Host.Local.Find(New Rxpath("/form[@processname='IKernel' and @class='#32770' and @visible='true' and @enabled='true' and @valid='true']")) , then it will continue.
We don't know why ,because if we directly launch functions from project A, it can smoothly pass.
Any ideas?
Steps:
1. Create a project A to uninstall an application at Control Panel->Add or Remove Programs.
the Rxpath of the form is "/form[@processname='IKernel' and @class='#32770' and @visible='true' and @enabled='true' and @valid='true']".
Ranorex.Form f=Host.Local.Find(New Rxpath("/form[@processname='IKernel' and @class='#32770' and @visible='true' and @enabled='true' and @valid='true']"))
2. finish functions and Compile this project
3. Create Another porject B , through reference to load in project A.
Invoke functions in Project A.
the program will hold for a long time,maybe 2~4 hour at Ranorex.Form f=Host.Local.Find(New Rxpath("/form[@processname='IKernel' and @class='#32770' and @visible='true' and @enabled='true' and @valid='true']")) , then it will continue.
We don't know why ,because if we directly launch functions from project A, it can smoothly pass.
Any ideas?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Host.Local.Find() cannot get the form, a strange issue??
The path you mention, does it refer to something in the Installer dialog which pops up, or to the steps before uninstalling takes place (in the Add/Remote Progams dialog) ?
Maybe you could attach your sample solution as a zip file ?
Does this happen with everything you uninstall or only with a specific application/installer?
Michael
Ranorex Team
Maybe you could attach your sample solution as a zip file ?
Does this happen with everything you uninstall or only with a specific application/installer?
Michael
Ranorex Team
Re: Host.Local.Find() cannot get the form, a strange issue??
Thanks ,pal. It happends during uninstalling,especially to find the last window,on which there is a Finish button.
My program is a bit complex , it consists of 7 calsses. This issue mostly happens at CurrentWin.cs , whose function is to find a specific window and calculate its elements ,as how many buttons/radiobuttons/checkbox at x-axis or y-axis.
I tried many times and i find each time this issue happens at an variable position ,
maybe at
Host.Local.Find("/form[@processname='IKernel' and @class='#32770' ]//Radiobutton")
or at
Host.Local.Find("/form[@processname='IKernel' and @class='#32770' ]//Container")
or at
Host.Local.Find("/form[@processname='IKernel' and @class='#32770' ]") .
whatever,just at Host.Local.Find....
I find if the processname is IKernel , it's easy to happen. On win7, uninstall is normal and did not meet the IKernel,therefore, no block . On XP,we will frequently meet IKernel.
I've upload the 3 files.
project Uninstall_All_3 will include project Newmode, Newmode will read UninstallInstall.xml
UninstallInstall.xml contains how to uninstall an application
My program is a bit complex , it consists of 7 calsses. This issue mostly happens at CurrentWin.cs , whose function is to find a specific window and calculate its elements ,as how many buttons/radiobuttons/checkbox at x-axis or y-axis.
I tried many times and i find each time this issue happens at an variable position ,
maybe at
Host.Local.Find("/form[@processname='IKernel' and @class='#32770' ]//Radiobutton")
or at
Host.Local.Find("/form[@processname='IKernel' and @class='#32770' ]//Container")
or at
Host.Local.Find("/form[@processname='IKernel' and @class='#32770' ]") .
whatever,just at Host.Local.Find....
I find if the processname is IKernel , it's easy to happen. On win7, uninstall is normal and did not meet the IKernel,therefore, no block . On XP,we will frequently meet IKernel.
I've upload the 3 files.
project Uninstall_All_3 will include project Newmode, Newmode will read UninstallInstall.xml
UninstallInstall.xml contains how to uninstall an application
You do not have the required permissions to view the files attached to this post.
Re: Host.Local.Find() cannot get the form, a strange issue??
the target application we'll uninstall is too big to upload ,30M. Thus ,i only upload the uninstall source code.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Host.Local.Find() cannot get the form, a strange issue??
I have tried different applications using InstallShield to reproduce your problem, but without success.
I also tried using your project A -> project B variant, which did work for me.
Do you know of a publicly available app which exhibits this particular behavior?
Michael
Ranorex Team
I also tried using your project A -> project B variant, which did work for me.
Do you know of a publicly available app which exhibits this particular behavior?
Michael
Ranorex Team
Re: Host.Local.Find() cannot get the form, a strange issue??
Thanks, Mickael. We only uninstall our own products, so i have no idea about other public application. All problems we met are relevant to process IKernel and AU_
I'lll try to find another way to solve this problem.
I'lll try to find another way to solve this problem.
Re: Host.Local.Find() cannot get the form, a strange issue??
I find it is strange in my CurrentWin.current function
1.
if i first ask it to find the window, it will finish in time; afterwards i ask it to find the element below form and it will hold for a long long time(maybe several hours)
[email protected]"@class='#32770' and @visible='true' and @enabled='true' and @valid='true' and @ProcessName='Ikernel' ";
RBs=Host.Local>Find(new RxPath(rxpath)); //instantly, it will find the form
[email protected]"@class='#32770' and @visible='true' and @enabled='true' and @valid='true' and @ProcessName='Ikernel' "[email protected]"//RadioButton[@visible='true' and @valid='true']";
RBs=Host.Local>Find(new RxPath(rxpath)); //suspend
2.
in the meantime, i open 2nd Ranorex Studio and create a new project, which only execute below codes. it will finish without suspending
[email protected]"@class='#32770' and @visible='true' and @enabled='true' and @valid='true' and @ProcessName='Ikernel' "[email protected]"//RadioButton[@visible='true' and @valid='true']";
RBs=Host.Local>Find(new RxPath(rxpath)); //instantly
1.
if i first ask it to find the window, it will finish in time; afterwards i ask it to find the element below form and it will hold for a long long time(maybe several hours)
[email protected]"@class='#32770' and @visible='true' and @enabled='true' and @valid='true' and @ProcessName='Ikernel' ";
RBs=Host.Local>Find(new RxPath(rxpath)); //instantly, it will find the form
[email protected]"@class='#32770' and @visible='true' and @enabled='true' and @valid='true' and @ProcessName='Ikernel' "[email protected]"//RadioButton[@visible='true' and @valid='true']";
RBs=Host.Local>Find(new RxPath(rxpath)); //suspend
2.
in the meantime, i open 2nd Ranorex Studio and create a new project, which only execute below codes. it will finish without suspending
[email protected]"@class='#32770' and @visible='true' and @enabled='true' and @valid='true' and @ProcessName='Ikernel' "[email protected]"//RadioButton[@visible='true' and @valid='true']";
RBs=Host.Local>Find(new RxPath(rxpath)); //instantly
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Host.Local.Find() cannot get the form, a strange issue??
Sorry but I have absolutely no idea what the problem could be. Try creating a snapshot in Spy (not screenshot) from your Form and post it here. Maybe i can find something suspicious.
(if you do not want to post it publicly, you can send it to [email protected] instead)
Michael
Ranorex Team
(if you do not want to post it publicly, you can send it to [email protected] instead)
Michael
Ranorex Team
Re: Host.Local.Find() cannot get the form, a strange issue??
Thanks for your responds, here i attached 3 pictures, stating what problem i met .
You do not have the required permissions to view the files attached to this post.
Re: Host.Local.Find() cannot get the form, a strange issue??
I can tell u one thing : if i click the button or close this window, Ranorex will respond immediately and keep on going.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Host.Local.Find() cannot get the form, a strange issue??
Hi,
With Snapshot I meant Ranorex Snapshot not screenshot.
Here's how to create a snapshot: (From the documentation)
Regarding your screenshots:
You might also try the following, slight modification of your code:
Does Ranorex only hang with this dialog or does it happen with other forms, too ?
From the other screenshot, it looks like Ranorex hangs or takes a long time while retrieving the child window of the form.
Michael
Ranorex Team
With Snapshot I meant Ranorex Snapshot not screenshot.
Here's how to create a snapshot: (From the documentation)
So please try to post a snapshot of your "Confirm uninstall" dialog.Save the Ranorex Snapshot file as follows:
* Open the Ranorex Spy
* Track your application
* Right click on the root element (form or dom)
* Save by clicking "Save as Snapshot..."
* Please ZIP your files if your file is larger than 500KB.
Regarding your screenshots:
You might also try the following, slight modification of your code:
Form yourForm = Host.Local.FindSingle<Form>(rxpath_form); IList<Element> elements = yourForm.Find(rxpath_elements);Also, why are you looking for a RadioButton in the your Form ?
Does Ranorex only hang with this dialog or does it happen with other forms, too ?
From the other screenshot, it looks like Ranorex hangs or takes a long time while retrieving the child window of the form.
Michael
Ranorex Team
Re: Host.Local.Find() cannot get the form, a strange issue??
Thanks,Michael.
This issue happends on several applications, not only on 'Confirm Uninstall' window and the finish window after you click OK, and it will not hang on fixed time,i mean this time it may hang on 'Confirm Uninstall' and next time it maybe hang on the finish window.
I get several specified elements(RadioButton,Checkbox,List,Button,Progressbar) to calculate to determine which kind of window it is.
Most time it like hanging on "/form[@visible='true' and @valid='true' and @enabled='true' and @Processname='IKernel']//RadioButton" ,which get all descendants.
"/form[@visible='true' and @valid='true' and @enabled='true' and @Processname='IKernel']" maybe hang ,not frequenter than the previous Rxpath.
This issue happends on several applications, not only on 'Confirm Uninstall' window and the finish window after you click OK, and it will not hang on fixed time,i mean this time it may hang on 'Confirm Uninstall' and next time it maybe hang on the finish window.
I get several specified elements(RadioButton,Checkbox,List,Button,Progressbar) to calculate to determine which kind of window it is.
Most time it like hanging on "/form[@visible='true' and @valid='true' and @enabled='true' and @Processname='IKernel']//RadioButton" ,which get all descendants.
"/form[@visible='true' and @valid='true' and @enabled='true' and @Processname='IKernel']" maybe hang ,not frequenter than the previous Rxpath.
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Host.Local.Find() cannot get the form, a strange issue??
Hmm your snapshots look harmless enough, i cannot find anything suspicious.
Some things you might consider, but otherwise I'm out of ideas:
1) Does your script run with administrative rights?
2) Do you have anything running on your test machine which might interfere with your test ?
(3rd party firewall, virus scanner, etc).
3) Is your XP running as a virtual machine?
4) Do you start additional threads ? Do you do something in parallel ? Do these run as STA?
5) Are all "Main" threads running as STA ? ([STAThread] attribute)
6) Do your hangs only happen with the "IKernel" process from Install Shield ?
Michael
Ranorex Team
Some things you might consider, but otherwise I'm out of ideas:
1) Does your script run with administrative rights?
2) Do you have anything running on your test machine which might interfere with your test ?
(3rd party firewall, virus scanner, etc).
3) Is your XP running as a virtual machine?
4) Do you start additional threads ? Do you do something in parallel ? Do these run as STA?
5) Are all "Main" threads running as STA ? ([STAThread] attribute)
6) Do your hangs only happen with the "IKernel" process from Install Shield ?
Michael
Ranorex Team
Re: Host.Local.Find() cannot get the form, a strange issue??
Thanks guys, bad news.
1) Does your script run with administrative rights? YES
2) Do you have anything running on your test machine which might interfere with your test ? NO. no firewall,virus software
(3rd party firewall, virus scanner, etc).
3) Is your XP running as a virtual machine? No
4) Do you start additional threads ? NO
Do you do something in parallel ? NO
Do these run as STA? Their relationship is
namespace 'Newmode'-->class 'Program'
namespace 'Newmode'-->class 'Recording1', class 'DefaultAction',class 'Actions',class 'CloseToppest'
5) Are all "Main" threads running as STA ? ([STAThread] attribute)
all classes are in 1 project
6) Do your hangs only happen with the "IKernel" process from Install Shield ?
It's frequent on IKernel from Install Shield
on Misexec,setup ,****.tmp not often, i meet 1 time on msiexec, also on a window ask me to click OK to uninstall,same window but diffrent processname.
1) Does your script run with administrative rights? YES
2) Do you have anything running on your test machine which might interfere with your test ? NO. no firewall,virus software
(3rd party firewall, virus scanner, etc).
3) Is your XP running as a virtual machine? No
4) Do you start additional threads ? NO
Do you do something in parallel ? NO
Do these run as STA? Their relationship is
namespace 'Newmode'-->class 'Program'
namespace 'Newmode'-->class 'Recording1', class 'DefaultAction',class 'Actions',class 'CloseToppest'
5) Are all "Main" threads running as STA ? ([STAThread] attribute)
all classes are in 1 project
6) Do your hangs only happen with the "IKernel" process from Install Shield ?
It's frequent on IKernel from Install Shield
on Misexec,setup ,****.tmp not often, i meet 1 time on msiexec, also on a window ask me to click OK to uninstall,same window but diffrent processname.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Host.Local.Find() cannot get the form, a strange issue??
This means, do you have enabled the STA attribute on your (main) thread. Please look into your program.cs file and check if the STAThread attribute is set.Do these run as STA? Their relationship is
namespace 'Newmode'-->class 'Program'
namespace 'Newmode'-->class 'Recording1', class 'DefaultAction',class 'Actions',class 'CloseToppest'
5) Are all "Main" threads running as STA ? ([STAThread] attribute)
all classes are in 1 project
// sample code // ... [STAThread] public static int Main(string[] args) // ...Regards,
Christian
Ranorex Team