Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
test row properties of webtable
#1
Solved: 11 Years, 4 Months ago
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,
Reply
#2
Solved: 11 Years, 4 Months ago
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"
Reply
#3
Solved: 11 Years, 4 Months ago
Many thanks for this solution
Reply
#4
Solved: 11 Years, 4 Months ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  DataGrid: double click on selected row robertosalemi 0 4,428 05-12-2016, 03:00 PM
Last Post: robertosalemi
  Row count is always shown as 1 Harry1999 0 2,086 04-14-2016, 11:11 PM
Last Post: Harry1999
  Keep row number imbizile 0 2,752 09-18-2014, 03:31 AM
Last Post: imbizile
  Retrieve row number based on value in DataTable marfa 6 30,727 07-31-2014, 08:36 PM
Last Post: dharshinishankari@gmail.com
  The recorded text output not appear on the correct row on the results datatable trance07 0 2,285 09-25-2013, 08:05 PM
Last Post: trance07

Forum Jump:


Users browsing this thread: 1 Guest(s)