Deadlock caused by RxPath(string) method

Bug reports.
oliver_hl
Posts: 5
Joined: Fri Nov 13, 2015 3:34 am

Deadlock caused by RxPath(string) method

Post by oliver_hl » Thu Nov 26, 2015 6:55 am

Below is a quote of code.It always hangs up unless I press LWin key.After debugging I found it fails at RxPath p=new RxPath(TextSearching).So I think it's bug.If the control role of "TextSearching" define in not vaild, RxPath(TextSearching) will never return.
string progressbarPath = @"/winapp[@packagename='windows.immersivecontrolpanel']/?/?/progressbar[@automationid='SystemSettings_MusUpdate_UpdateStatus_DeterminateProgressBar']";

System.DateTime	past = System.DateTime.Now.AddMinutes(60);
if(WinExists(progressbarPath,10))
{
  Ranorex.ProgressBar progressBarItem = progressbarPath;
  do
  {
    Delay.Seconds(10);
	
	if(System.DateTime.Now>past)
	{
	  Report.Info("Time out");
	  return;
	}
  }while(WinExists(progressbarPath,10));
}

public static bool WinExists(string TextSearching,int Tim)
{
  Element item;
  System.DateTime past=System.DateTime.Now.AddSeconds(Tim);
  
  RxPath p=new RxPath(TextSearching);
  do
  {
    try
	{
	  item=Host.Local.FindSingle(p);
	  if (item !=null)
	  {
	   return true;
	  }
	  else
	  {
	    Delay.Seconds(2);
	  }
	}
	catch(ElementNotFoundException)
	{
	  Delay.Seconds(2);
	}
  } while (System.DateTime.Now<past);
			
   return false;
}
Last edited by oliver_hl on Tue Dec 01, 2015 6:53 am, edited 1 time in total.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Deadlock caused by RxPath(string) method

Post by Support Team » Mon Nov 30, 2015 3:29 pm

Hello oliver_hl,

Unfortunately, we aren’t able to reproduce the mentioned issue on our machines.

May I ask which version of Ranorex you are currently using? If you are using an older version than Ranorex 5.4.4 I would highly recommend updating. Therefore, please remove Ranorex from your machine completely. Afterwards, reboot your machine and install the latest version of Ranorex, currently Ranorex 5.4.4.
Please let us know if the issue still occurs.

Sincerely,
Robert
.
Image

oliver_hl
Posts: 5
Joined: Fri Nov 13, 2015 3:34 am

Re: Deadlock caused by RxPath(string) method

Post by oliver_hl » Tue Dec 01, 2015 6:51 am

Thank you for your reply.

At the very beginning, I met this issue with Ranorex 5.4.0.So I update it to Ranorex 5.4.3, the issue is still there.
Just want to remind you, this issue is not duplicated 100%.Usually I set launch it 5 cycles, and it's easy to reproduce.Could you try this?

It happens when the prograssbar is not there where my program tries to find it.It's supposed to return false while it never returns but hangs there.


Today, I update Ranorex to 5.4.4.I still can reproduce it.Could you help on this ASAP?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Deadlock caused by RxPath(string) method

Post by Support Team » Wed Dec 02, 2015 12:47 pm

Hello oliver_hl,
It happens when the prograssbar is not there
May I ask how I can bring up that specific progressbar on my machine?

Thanks,
Robert
.
Image

oliver_hl
Posts: 5
Joined: Fri Nov 13, 2015 3:34 am

Re: Deadlock caused by RxPath(string) method

Post by oliver_hl » Thu Dec 03, 2015 2:28 am

The progress bar appears after I click "Check for Updates" button.

The process like below:
1. Press "LWin+I" to launch PC Settings in Windows 10;
2. Maximize the form and Click "Update & Security" button;
3. Click "Check for Updates" button;
4. Wait for prograss bar appears to when it disappears.

You can try the code file attached.

Thanks.
Attachments
Recording1.UserCode.cs
(3.25 KiB) Downloaded 51 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Deadlock caused by RxPath(string) method

Post by Support Team » Mon Dec 07, 2015 1:50 pm

Hello oliver_hl,

Thank you for providing the needed information.

Unfortunately, I was not able to reproduce mentioned behavior on our machines, even when using the provided code snippet.

Anyway, I would recommend using a WaitForExists() against the "Check for updates"-button after clicking it. Otherwise, when using your code, the progress bar disappears several times for a short period of time, even when there are updates left. In that case, your test would just continue.

Hope this information helps.

Sincerely,
Robert
.
Image

oliver_hl
Posts: 5
Joined: Fri Nov 13, 2015 3:34 am

Re: Deadlock caused by RxPath(string) method

Post by oliver_hl » Tue Dec 08, 2015 3:26 am

Otherwise, when using your code, the progress bar disappears several times for a short period of time, even when there are updates left. In that case, your test would just continue.
My test did not continue but just hang there for hours.That's what I concern.If progress bar disappears and my code catch it, my test is supposed to exit.

It's a intermittent issue with high fail rate.What about trying more times in your site Like below?

1.Run you the test
2.Reboot
3.Run you the test
4.Reboot
....

I have done a lot of debugging in my site and my view is that RxPath function not return when the progress bar not exist during RxPath initializes the progress control.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Deadlock caused by RxPath(string) method

Post by Support Team » Thu Jan 21, 2016 1:41 pm

Hello oliver_hl,

Please excuse my late reply.

In case you are still facing the issue, please contact [email protected]

Sincerely,
Robert
.
Image

oliver_hl
Posts: 5
Joined: Fri Nov 13, 2015 3:34 am

Re: Deadlock caused by RxPath(string) method

Post by oliver_hl » Mon Feb 01, 2016 9:21 am

Yes, the issue is still there. And my automation has been blocked since.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Deadlock caused by RxPath(string) method

Post by Support Team » Thu Feb 04, 2016 9:42 am

Hello oliver_hl,

I'm afraid that we didn't receive an email from you until now. Please contact us in case you need any help.

Sincerely,
Robert
.
Image