Element found in Spy but not in Test

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Element found in Spy but not in Test

Post by UgaAga » Thu Jul 19, 2012 1:16 pm

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

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

Re: Element found in Spy but not in Test

Post by Support Team » Fri Jul 20, 2012 10:33 am

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
.
Image

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: Element found in Spy but not in Test

Post by UgaAga » Fri Jul 20, 2012 11:23 am

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

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

Re: Element found in Spy but not in Test

Post by Support Team » Fri Jul 20, 2012 1:41 pm

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
.
Image

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: Element found in Spy but not in Test

Post by UgaAga » Fri Jul 20, 2012 2:48 pm

It works now. I forgot to set a variable in the code.

Thanks