Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to script this
#1
Solved: 11 Years, 4 Months ago
Hi, i have a script using exl as global datasheet. just want to know how to design this

1. in the application there is a list of checkbo

party type checkbox
A
B
C
D
etc

Currently, in my datasheet i have

party1 party2 party3
A B C

if my script
.... settoproperty ("text", datatable("party1", dtglobalsheet)
if exists then i want to set checbox A to "ON", but all party have the same checkbox name, so how do i get the right checkbox

thanks
Reply
#2
Solved: 11 Years, 4 Months ago
just want to explain it a bit clearly. in my application, there is webelement with the same name for all parties, for each party there is webcheckbox with name ptyflg for party, ptyflg$0 for party2 and ptyflg$1 for party and so on.

if party A exists in global data sheet then i want to make ptyflg = on,
and if party c eixts then i want to make ptyflg$1 = on. i can not work out the connection between the two.
Reply
#3
Solved: 11 Years, 4 Months ago
Hi Jenny,

I am clearing how much i have understood your doubt...
Checkbox in App <> Datatable Data
A <> ptyflg
B <> ptyflg
C <> ptyflg
If PartyA.Exists Then
'select ptyflg
End If


If this is where you are stuck, then you can make use of the "index" property of those check boxes.
If this is not clear pls let me know along with piece of code you have written.
Reply
#4
Solved: 11 Years, 4 Months ago
my question if A, B, C are values stored in the datasheet and not appear in the same order on the screen. So if i pick up B, how do i work out the index for ptyflg for B.
Reply
#5
Solved: 11 Years, 4 Months ago
Use the GetROProperty("property name"), use the property name which will give you unique value for each checkbox.
ELSE
I need piece of code you have written, pls do paste here.
Reply
#6
Solved: 11 Years, 4 Months ago
Hi, thank you for the reply. please see the attachment, not sure if attachment work.

‘IF A found from xls then set the check box to on
Code:
If DataTable("A", dtGlobalSheet) = "ON" then
   ChkName = "dcmtptyFlag$2"  
    Browser("JUSTICEMAX_2").Page("JUSTICEMAX").WebCheckBox("dcmtptyFlag").SetTOProperty "name",  ChkName
    Browser("JUSTICEMAX_2").Page("JUSTICEMAX").WebCheckBox("dcmtptyFlag").Set "ON"
End If

however this is hard coded, i want to have a more flexible here, does not matter where A exists, then get the relevant checkbox, so name could be "dcmtptyFlag$2" or could be "dcmtptyFlag$30"


Attached Files
.doc   checkbox_help.doc (Size: 92 KB / Downloads: 106)
Reply
#7
Solved: 11 Years, 4 Months ago
Hi Jenny, pls don't mind...it would be better if you could paste the screen shot of the application (here iff its possible) rather than object repository?
Reply
#8
Solved: 11 Years, 4 Months ago
Hi, i can not paste the screen shots here
Reply
#9
Solved: 11 Years, 4 Months ago
Sad
there will be some thing common that can be used for DP, thats y asked for app screenshot.
From Object repository...i am not clearly getting it.
From the screen shots that u have provided, we have only one information that is "index:=0", which u had told already that it wont work.
Reply
#10
Solved: 11 Years, 4 Months ago
sorry misread your mail, you want the screen shot of the application, i will do that 1st thing tomorrow.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)