Span tag not visible even when it is..
Posted: 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?
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?