Span tag not visible even when it is..

Ask general questions here.
winnicki
Posts: 5
Joined: Wed Sep 14, 2011 5:54 pm

Span tag not visible even when it is..

Post by winnicki » Fri Oct 07, 2011 9:09 pm

UPDATE:
I found a workaround. For some reason the path that the Spy is giving me doesn't work but if I do this it returns the correct SpanTag element.

SpanTag ttlFrmSch = repos.Website.Self.FindSingle(".//span[@id='ctl00_ContentPlaceHolder1_tableAvGen_Total_rowPowerexScheduledEnergyLabels']");

I still don't understand why the path wouldn't work for this though.

ORIGINAL QUESTION:

I'm using the Spy to add an element to my repository. Here is the path:

/dom[@domain='example.com']/body/form/div[3]/div/div/table[@id='ctl00_ContentPlaceHolder1_Table2']/tbody/tr[2]/td/div/table/tbody/tr[@id='ctl00_ContentPlaceHolder1_tableAvGen_rowPowerexScheduledEnergyLabels']/td[@id='ctl00_ContentPlaceHolder1_tableAvGen_cell_Total_rowPowerexScheduledEnergyLabels']/span[@id='ctl00_ContentPlaceHolder1_tableAvGen_Total_rowPowerexScheduledEnergyLabels']

example.com is used for confidential reasons. on the webpage, the element is actually just some text contained within a <span> that is within a <td>. what it looks like the spy is eventually giving me is a span element which is expected. For the life of me, however, I can't get it to be visible even when it is visible on screen. I tried many different things.

// the item from repository with the above path
SpanTag ttlFrmSch = repos.Website.data_table.total_firm_sched;
if (ttlFrmSch.Visible)
do something
else
do something else

it doesn't even evaluate the if statement .. it does nothing. The element is visible on the screen and says it's visible in the spy . I tried printing out the inner text of the element which did nothing as well. I also tried using WebElement and other objects in case I was using the wrong object.

I know you're probably going to ask me for a screenshot but I don't think I can actually give you one because the site is confidential. Do you have any ideas why this might not be visible?

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

Re: Span tag not visible even when it is..

Post by Support Team » Mon Oct 10, 2011 2:04 pm

Hi,
winnicki wrote:Do you have any ideas why this might not be visible?
If I understand you correctly, the element in Spy is shown as visible but is isn't right?
Occurs this issue in both browser (IE, Firefox) or only in a specific ones?
Did you try to call the Ensure Visible method on this element?
Is this only with this special span tag or did you see this behavior on another element?
Did you find the element? If not, could it be possible that the RxPath before this element changes?
winnicki wrote:I know you're probably going to ask me for a screenshot but I don't think I can actually give you one because the site is confidential
Yes, a Ranorex Snapshot would be very helpful. Maybe it is possible to send it to our support mail address?
[email protected]

Regards,
Peter
Ranorex Team
.
Image