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?
Span tag not visible even when it is..
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Span tag not visible even when it is..
Hi,
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?
[email protected]
Regards,
Peter
Ranorex Team
If I understand you correctly, the element in Spy is shown as visible but is isn't right?winnicki wrote:Do you have any ideas why this might not be visible?
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?
Yes, a Ranorex Snapshot would be very helpful. Maybe it is possible to send it to our support mail address?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
[email protected]
Regards,
Peter
Ranorex Team