Sunday, June 14, 2020

Working with different controls in Test complete

Working with different controls in Test complete

Button
  1. To click button- mybutton.clickmybutton.clickbuttonmybotton.keys “~F” (shortcut assigned to that button ex. Find), sys.keys [tab][tab] sys.keys[x32] (keystroke of navigation)
  2. To check button state- mybutton.enable
  3. To take image of the button – mybutton.wimage

Checkbox
  1. To select or unclear the checkbox – mycheckbox.clickbutton cbuncheckedmycheckbox.clickbutton cbcheckedmycheckbox.click (toggle using select/unselect), mycheckbox.keys[tab] mycheckbox.keys[x32](using keystrokes)
  2. To check the state of checkbox – mycheckbox.wstate
  3. Checkbox image – mycheckbox=sys.process(“mapp”).window(“mywindow”).window(“checkbox”), mycheckbox.wimage

Combobox
  1. Type of combobox – simple combox with edit option, dropdown with list option, drop down combo box with edit option
  2. 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)
  3. 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
  4. Get the number of item count in combo- mycombo.witemcount
  5. To take image of correspond item’s default image- mycombo.witemimage, item’s selected image- mycombo.witemselectedimage

Edit
  1. Getting edit control text- editctrl=sys.process(“notepad”).window(“notepad”).window(“edit”), editctrl.keys(“this is my text”), mytxt=editctrl.wtext
  2. Entering text in edit- editctrl.wtexteditctrl.settexteditctrl.keys(“text”)
  3. Working with password- edit.wpasswordchar
  4. Obtain text limit in edit – edit.wlimt

Radiobutton
  1. Selecting radio button- myradio.setfocusmyradio.clickmyradio.clickbutton()
  2. State of radio button- myradio.wchecked
  3. Get image of radio button- myradio.wimage
  4. Working with radiogroupmyradiogroup.setfocu

Listbox
  1. Select single item from list -mylist.clickitem(index), mylist.dbclickitemmylist.selectitem(index), mylist.keys(index), mylist.keys[tab] (keystroke)
  2. Select multiple items from list- str=item1,item2, mylist.multiselect(str)
  3. Getting single list item- mlist.witem(index)
  4. Getting multiple list item – mylist.wselecteditemsmylist.witemlist
  5. Number of list item count- mylist.witemcount
  6. Determine current item- mylist.wfocus
  7. Checking list box item selected or not- mylist.wselected(index)

No comments:

Post a Comment