Working with different controls in Test complete
Button
- To click button- mybutton.click, mybutton.clickbutton, mybotton.keys “~F” (shortcut assigned to that button ex. Find), sys.keys [tab][tab] sys.keys[x32] (keystroke of navigation)
- To check button state- mybutton.enable
- To take image of the button – mybutton.wimage
Checkbox
- To select or unclear the checkbox – mycheckbox.clickbutton cbunchecked, mycheckbox.clickbutton cbchecked, mycheckbox.click (toggle using select/unselect), mycheckbox.keys[tab] mycheckbox.keys[x32](using keystrokes)
- To check the state of checkbox – mycheckbox.wstate
- Checkbox image – mycheckbox=sys.process(“mapp”).window(“mywindow”).window(“checkbox”), mycheckbox.wimage
Combobox
- Type of combobox – simple combox with edit option, dropdown with list option, drop down combo box with edit option
- Select item from combobox – mycombo.clickitem(“Apple”), mycombo.clickitem(3) (by caption or index, we cant select multiple together), mycombo.keys(4), mycombo.keys[down](by keystroke as well and up and down method too)
- Getting combo box item- mycombobox.wItem(5) return the name of the item by given index, windex=mycombo.selectedindex,mycombo.witem(windex) will return selected item value, mycombo.witemlist will give array of all items from the list and need to write for loop to get all items using aqstring.getlistitem
- Get the number of item count in combo- mycombo.witemcount
- To take image of correspond item’s default image- mycombo.witemimage, item’s selected image- mycombo.witemselectedimage
Edit
- Getting edit control text- editctrl=sys.process(“notepad”).window(“notepad”).window(“edit”), editctrl.keys(“this is my text”), mytxt=editctrl.wtext
- Entering text in edit- editctrl.wtext, editctrl.settext, editctrl.keys(“text”)
- Working with password- edit.wpasswordchar
- Obtain text limit in edit – edit.wlimt
Radiobutton
- Selecting radio button- myradio.setfocus, myradio.click, myradio.clickbutton()
- State of radio button- myradio.wchecked
- Get image of radio button- myradio.wimage
- Working with radiogroup- myradiogroup.setfocu
Listbox
- Select single item from list -mylist.clickitem(index), mylist.dbclickitem, mylist.selectitem(index), mylist.keys(index), mylist.keys[tab] (keystroke)
- Select multiple items from list- str=item1,item2, mylist.multiselect(str)
- Getting single list item- mlist.witem(index)
- Getting multiple list item – mylist.wselecteditems, mylist.witemlist
- Number of list item count- mylist.witemcount
- Determine current item- mylist.wfocus
- Checking list box item selected or not- mylist.wselected(index)
No comments:
Post a Comment