Micro Focus QTP (UFT) Forums
test row properties of webtable - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: test row properties of webtable (/Thread-test-row-properties-of-webtable)



test row properties of webtable - gerfred - 09-24-2010

Hi,

I've a webtable with multiple rows and I need to test class property (at least) to verify if row is or isn't selected.

The property i ve to check is TR class value.

It try to get class value but fail each time.

The code is something like :

Code:
<TABLE class="xxxx" id=Menu_0 style="xxxx" tabIndex=0 >
<TBODY class=xxxxyy>

<[b]TR class="xxx yySelected" [/b]id=MenuItem_0 tabIndex=-1 >
    <TD class=zzzzz>
          <IMG class=uuuuu alt="" src="http://jjjjj/blank.gif" >
   </TD>
   <TD class="fgfgf" id=MenuItem_0_text colSpan=2>[b]LABEL1[/b]
   </TD>
   <TD class="dfdfdf" id=MenuItem_0_accel>
   </TD>
   <TD class="fgjfghj" >
          <DIV ><IMG class=sdfgsdfg alt="" src="http://jjjj/blank.gif">
                <SPAN class=dsdfsdfsdf>+</SPAN>
          </DIV>
    </TD>
</TR>

<TR class="xxx yyDisabled" id=MenuItem_0 tabIndex=-1 >
    <TD class=zzzzz>
          <IMG class=uuuuu alt="" src="http://jjjjj/blank.gif" >
   </TD>
   <TD class="fgfgf" id=MenuItem_0_text colSpan=2>LABEL2
   </TD>
   <TD class="dfdfdf" id=MenuItem_0_accel>
   </TD>
   <TD class="fgjfghj" >
          <DIV ><IMG class=sdfgsdfg alt="" src="http://jjjj/blank.gif">
                <SPAN class=dsdfsdfsdf>+</SPAN>
          </DIV>
    </TD>
</TR>

<TR class="xxx yyDisabled" id=MenuItem_0 tabIndex=-1 >
    <TD class=zzzzz>
          <IMG class=uuuuu alt="" src="http://jjjjj/blank.gif" >
   </TD>
   <TD class="fgfgf" id=MenuItem_0_text colSpan=2>LABEL3
   </TD>
   <TD class="dfdfdf" id=MenuItem_0_accel>
   </TD>
   <TD class="fgjfghj" >
          <DIV ><IMG class=sdfgsdfg alt="" src="http://jjjj/blank.gif">
                <SPAN class=dsdfsdfsdf>+</SPAN>
          </DIV>
    </TD>
</TR>

</TBODY>
</TABLE>


I need to find a way to check that bolded class contain or not the "yySelected" value
Using GetRowWithCellText("LABEL1") I'm able to get row number in table but i'm still not able to get class value of this row


Regards,


RE: test row properties of webtable - cdesserich - 09-28-2010

You can use the row index you find with GetRowWithCellText("LABEL1") with ChildObjects() of the WebTable to check your class property. Something like:

Code:
Set desc = Description.Create
desc("micclass").Value = "WebElement"
desc("html tag").Value = "TR"

row = Browser("Browser").Page("Page").WebTable("LABEL1").GetRowWithCellText("LABEL1")
Set rows = Browser("Browser").Page("Page").WebTable("LABEL1").ChildObjects(desc)
rows.Item(row-1).CheckProperty "class", "xxx yySelected"



RE: test row properties of webtable - gerfred - 09-28-2010

Many thanks for this solution


RE: test row properties of webtable - sreekanth chilam - 09-29-2010

Hi Guys,

Suggest you to go through the Posting Guidelines.
Preview post > Wrapup the code using "Insert Formatted code" > PostReply
so that post would be more readable,understandable Smile