![]() |
|
how to script this - 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: how to script this (/Thread-how-to-script-this) Pages:
1
2
|
how to script this - Jenny - 10-19-2010 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 RE: how to script this - Jenny - 10-19-2010 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. RE: how to script this - KavitaPriyaCR - 10-19-2010 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. RE: how to script this - Jenny - 10-20-2010 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. RE: how to script this - KavitaPriyaCR - 10-20-2010 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. RE: how to script this - Jenny - 10-21-2010 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" thenhowever 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" RE: how to script this - KavitaPriyaCR - 10-21-2010 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? RE: how to script this - Jenny - 10-21-2010 Hi, i can not paste the screen shots here RE: how to script this - KavitaPriyaCR - 10-21-2010 ![]() 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. RE: how to script this - Jenny - 10-21-2010 sorry misread your mail, you want the screen shot of the application, i will do that 1st thing tomorrow. |