Button control is invalid

Ask general questions here.
petercrowley
Posts: 2
Joined: Wed Aug 17, 2016 2:55 pm

Button control is invalid

Post by petercrowley » Wed Aug 17, 2016 3:26 pm

Hi All,

I am running a stress test that executes multiple steps 500 times/cycles.

One of the steps is to click a button control.

The test runs as expected for approximately 300-400 cycles then fails because the button control becomes invalid. The button control is visible on the screen but the ranorex report states that it is invalid.

The code is follows:

public static void selectBack()
{
UpperNavBarRepo.Instance.UpperNavBarButtonVar = "Back";
UpperNavBarRepo.Instance.HostServiceProvider.UpperNavBarButton.Click();
Delay.Seconds(2);
Report.Info("Back clicked");
}

Why does the button control suddenly become invalid?
What can cause a control to become invalid?
Is there anything I can do to make the control valid again?

Regards,
PC

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Button control is invalid

Post by odklizec » Thu Aug 18, 2016 12:26 pm

Hi,

I'm afraid, there is not enough information in your post to provide a reasonable answer. There are too many unknowns. Please answer the following questions...

Ranorex version?
Could you please post an exact error message you are getting when it fails (ideally post entire report)?
Could you please post the xpath behind the "UpperNavBarButton" element?
Also, please post a Ranorex snapshot of UpperNavBarButton element.

Additionally, add a step in your test to store snapshot of the parent element of UpperNavBarButton element, just before 'click' action. Then make sure the test ends execution after failure.
Once the test fails (due to invalid element), examine the snapshot of the parent element, if it contains the UpperNavBarButton element or not. If it does, examine its xpath, if it matches the one stored in repo or not.
Pavel Kudrys
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

petercrowley
Posts: 2
Joined: Wed Aug 17, 2016 2:55 pm

Re: Button control is invalid

Post by petercrowley » Mon Aug 22, 2016 5:02 pm

Hi,

Please find the answers to your questions below:

1) What version of Ranorex?
5.4.5

2) Could you please post an exact error message you are getting when it fails?
See attached file, Ranorex Report.zip

3) Could you please post the xpath behind the "UpperNavBarButton" element?
container[@controlname='panelPages1']/container[@caption='Page' and @controltypename='Page' and @instance='0']//container[@controlname>$UpperNavBarButtonVar]

4) Post a Ranorex snapshot of UpperNavBarButton element.
See attached file, Back_Button_Snapshot.rxsnp

5) Add a step in your test to store snapshot of the parent element of UpperNavBarButton element, just before 'click' action.
See attached file, StressTests_20160819_145550_0_rxlog.zip

Regards,
Peter
Attachments
StressTests_20160819_145550_0_rxlog.zip
(1.38 MiB) Downloaded 30 times
Back_Button_Snapshot.rxsnp
(131.84 KiB) Downloaded 23 times
Ranorex Report.zip
(2.23 MiB) Downloaded 28 times

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

Re: Button control is invalid

Post by Support Team » Thu Aug 25, 2016 1:47 pm

Hi Peter,

In order to analyze your issue in more detail, it would be great if you could send an email to [email protected] with a detailed description of your problem.

We can arrange a remote session if it's necessary.

I'm looking forward to your email.

Sincerely,
Matthias
.
Image