Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to script this
#11
Hi, please see attachment for app screen shots. Hope you can help
thaks


Attached Files
.doc   checkbox_help.doc (Size: 133 KB / Downloads: 122)
Reply
#12
Jenny as u said "if I pick up FD with value = ‘ON’, then search the party type on the screen to find the matching one, then check the checkbox for the found one."

This indecates you need to search the check box if its corresponding value in DT is "ON", so you should have one more column for "Party Type" (there must be atleast one data to search right? You have also told that data table values are not in order and u cant use index value) Then,

Pick up FD with value = ‘ON’, take PartyType of that FD,
then search the party type on the screen to find the matching one,
then check the checkbox for the found one.

This could be possible.
Reply
#13
HI Jenny,

Try to implement accordingly by seeing the below example,you can do it easily.

Code:
ExpectedPartyType="FD" For m=1 to DataTable.GetSheet(dtGlobalSheet).GetParameterCount If (DataTable.GetSheet(dtGlobalSheet).GetParameter(m).Name=ExpectedPartyType) And (DataTable.GetSheet(dtGlobalSheet).GetParameter(m).Value="ON") Then For n=1 to Browser().Page().WebTable().Rowcount CurrentPartyType=Browser().Page().WebTable().GetCellData(n,2) If (CurrentPartyType=ExpectedPartyType) Then Browser().Page().WebTable().ChildItem(n,1,"WebCheckBox",0).Set "ON" Chk_Selected=True Exit For End if Next End if If Chk_Selected=True then Exit For End if Next
Reply
#14
Hi, thanks for the code, i have tried this, but i keep getting error message with webtable not in object repository. please have a look at my attacemnet. the two fields eixst as webelement and webcheckbox.
when i used ojbect spy, i know these 2 fields come from webtable with name = "dcmtflag". Any more suggestiong would be most appreciated
thanks again


Attached Files
.doc   checkbox_help.doc (Size: 92 KB / Downloads: 115)
Reply
#15
Hi Jenny,
Can't this can be done by If -- ElseIf:

In datatable add a column by name CheckBoxName and enter the name of checkbox you want to tag.
e.g.: party A, party B.....so on.
Code:
If DataTable("CheckBoxName", dtGlobalSheet) = "party A" Then ChkName = "dcmtptyFlag" ElseIf DataTable("CheckBoxName", dtGlobalSheet) = "party B" Then ChkName = "dcmtptyFlag$0" ElseIf DataTable("CheckBoxName", dtGlobalSheet) = "party C" Then ChkName = "dcmtptyFlag$1" End If Browser("JUSTICEMAX_2").Page("JUSTICEMAX").WebCheckBox("dcmtptyFlag").SetTOProperty "name", ChkName Browser("JUSTICEMAX_2").Page("JUSTICEMAX").WebCheckBox("dcmtptyFlag").Set "ON"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)