Page 1 of 1

Element found in Spy but not in Test

Posted: Thu Jul 19, 2012 1:16 pm
by UgaAga
Hi,
several elements of my repository are found if i highlight them via the spy. If i run the test, the elements aren't found anymore. In another case the element (a list) is found in test, but isn't found anymore after changing the selection.

My elements:

Code: Select all

<item name="ButtonChannelForceValueStatusOn" id="3d714d66-57a5-4d40-8fab-b5e44b1da2e1" searchtimeout="30000ms" capname="buttontag" addcaps="unknown,webelement,buttontag">
							/dom[@caption~'PMX UE']/.//div[#'p_PMXAmplifierSetting']/div[2]/div[@childindex=$channelindex]/div[14]/div/button[@innertext='on']
						</item>

Code: Select all

					<item name="SelectPhysicalUnit" id="9742a56b-6ab3-4314-8616-7af3954e4ef0" searchtimeout="30000ms" capname="selecttag">
						/dom[@caption~'PMX UE']/.//div[@class='PMX_PeakValueChannelGrid']/..//div[@innertext='Physical Unit']/following-sibling::select
					</item>
Thanks

Re: Element found in Spy but not in Test

Posted: Fri Jul 20, 2012 10:33 am
by Support Team
Hi,

To solve your problem it would be very helpful if you could send me some snapshots of the elements where the problem occurs, e.g. the list-element.

How to create snapshots:
http://www.ranorex.com/support/user-gui ... files.html

It may be that some attributes of the elements used in the RXPath get changed during test and so they can't be found anymore.

This link give some helpful information about RXPath:
http://www.ranorex.com/support/user-gui ... ditor.html

Kind regards,
Larissa
Ranorex Support Team

Re: Element found in Spy but not in Test

Posted: Fri Jul 20, 2012 11:23 am
by UgaAga
Hi Larissa,
ok i will send you a snapshot later on.
The element is found the first time i use it, but not for the second time. I do as the following:

Code: Select all

Dim elementOnElement As WebElement = PmxRepository.Instance.DomMain.Content.Amplifier.Px878.ButtonChannelForceValueStatusOn.Element
Dim elementOffElement As WebElement = PmxRepository.Instance.DomMain.Content.Amplifier.Px878.ButtonChannelForceValueStatusOff.Element

Dim elementOnActive As Boolean = elementOnElement.Class.Contains("active")
Dim elementOffActive As Boolean = elementOffElement.Class.Contains("active")

If not elementOnActive AndAlso elementOffActive Then
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'DomMain.Content.Amplifier.Px878.ButtonAmplifierForceValueStatusOn' at Center.", PmxRepository.Instance.DomMain.Content.Amplifier.Px878.ButtonChannelForceValueStatusOnInfo)
PmxRepository.Instance.DomMain.Content.Amplifier.Px878.ButtonChannelForceValueStatusOn.Click(MoveTime)

End If
Bye

Re: Element found in Spy but not in Test

Posted: Fri Jul 20, 2012 1:41 pm
by Support Team
Hi,

It would be nice to see the RxPath, not just the RepositoryItems, since the useful information is embedded in the RxPath.

Thanks,
Larissa
Ranorex Support Team

Re: Element found in Spy but not in Test

Posted: Fri Jul 20, 2012 2:48 pm
by UgaAga
It works now. I forgot to set a variable in the code.

Thanks