import re
import subprocess
from ldtp import *
from vm import *
from objname import *
from generalactions import GeneralActions
from settings import Settings
from snapshot import Snapshot
from commonutils import *


class TeamRethinkRecovery:
    def __init__(self, harness):
      self.harness = harness
    def startRecovery(self):
      vmInst = VM(self.harness)
      vmGeneral = GeneralActions(self.harness)
      self.harness.VerifySafely(vmInst.VerifyPowerOffVM(), True,"Power Off VM")
      self.harness.VerifySafely(vmInst.VerifyDeleteVM(), True,"Delete VM")
      self.harness.VerifySafely(vmInst.VerifyCloseWorkstation(), True, "Close workstation")
      vmGeneral.DeleteTestVMDir()

class test1:
    '''
    TeamRethink01    Button Advnaced in the VM Settings Network Adapter panel
    TeamRethink02    Open NAAS (Network Adapter Advanced Settings) dialog using button click
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):

        self.harness.SetTestDescription("Button Advnaced in the VM Settings Network Adapter panel")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("Tab to Advanced button")
        for i in range(0, 4):
           enterstring('<Tab>')

        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,state.FOCUSED)
        self.harness.VerifySafely(status,True,"<Tab> to button 'Advanced...' works")
        self.harness.AddTestComment("<Shift><Tab> to Advanced button")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        for i in range(7):
           enterstring('<Shift><Tab>')
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,state.FOCUSED)
        self.harness.VerifySafely(status,True,"<Shift><Tab> to button 'Advanced...' works")
        self.harness.AddTestComment("Click <Enter> button")
        enterstring('<Enter>')
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("Close Dialog 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("use access key 'Alt + v' to access Advanced button")
        generalInst.SendKeyboardInput('<alt>v',vmSettingsWindow,btnSave)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("Close Dialog 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("Close Dialog 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test2:
    '''
    TeamRethink05    NAAS dialog UI
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):

        self.harness.SetTestDescription("NAAS dialog UI")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(objectexist(frmNetworkAdapterAdvancedSettings,'*IncomingTransfer')) # use '*' becsause ID in Windows8 is diffrerent from in Windows7
        self.harness.VerifySafely(status,True,"group 'Incoming Transfer' exist")
        status = bool(objectexist(frmNetworkAdapterAdvancedSettings, '*OutgoingTransfer'))
        self.harness.VerifySafely(status,True,"group 'Outgoing Transfer' exist")
        status = bool(objectexist(frmNetworkAdapterAdvancedSettings, '*MACAddress' ))
        self.harness.VerifySafely(status,True,"group 'Mac Address' exist")
        #3. Verify two groups of controls has the same elements
        #4. Verify all controls in the dialog have access keys
        generalInst.SendKeyboardInput('<alt>B',frmNetworkAdapterAdvancedSettings,btnOK)
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,cboBandwidth,"FOCUSED")
        self.harness.VerifySafely(status, True,'combo box "Bandwidth" get focus with key "<Alt> B"')
        generalInst.SendKeyboardInput('<alt>K',frmNetworkAdapterAdvancedSettings,btnOK)
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtKbps,state.FOCUSED)
        self.harness.VerifySafely(status, True,'text field "Kbps" get focus with key "<Alt> K"')
        generalInst.SendKeyboardInput('<alt>P',frmNetworkAdapterAdvancedSettings,btnOK)
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtPacketLoss,state.FOCUSED)
        self.harness.VerifySafely(status, True,'text field "PacketLoss"get focus with key "<Alt> P"')
        generalInst.SendKeyboardInput('<alt>a',frmNetworkAdapterAdvancedSettings,btnOK)
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,cboBandwidth1,"FOCUSED")
        self.harness.VerifySafely(status, True,'combo box "Bandwidth1" get focus with key "<Alt> a"')
        generalInst.SendKeyboardInput('<alt>s',frmNetworkAdapterAdvancedSettings,btnOK)
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtKbps1,state.FOCUSED)
        self.harness.VerifySafely(status, True,'text field "Kbps1" get focus with key "<Alt> s"')
        generalInst.SendKeyboardInput('<alt>L',frmNetworkAdapterAdvancedSettings,btnOK)
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,state.FOCUSED)
        self.harness.VerifySafely(status, True,'text field "PacketLoss1" get focus with key "<Alt> L"')
        # There is a defect on LDTP, the text field can not get focus when I use "<Alt> M" in script
        generalInst.SendKeyboardInput('<alt>M',frmNetworkAdapterAdvancedSettings,btnOK)
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtMACAddress,state.FOCUSED)
        self.harness.VerifySafely(status, True,'text field "MAC Address" get focus with key "<Alt> M"')
        generalInst.SendKeyboardInput('<alt>G',frmNetworkAdapterAdvancedSettings)
        status = bool(re.match('([a-zA-Z0-9]{2}:){5}[a-zA-Z0-9]{2}',gettextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress)))
        self.harness.VerifySafely(status, True,'new MAC Address generate with key "<Alt> G"')
        # UI change? Help have no shortcutkey
#       generalInst.SendKeyboardInput('<alt>H',frmNetworkAdapterAdvancedSettings,btnClose)
#       status = bool(waittillguiexist(frmVirtualNetworkHelp))
#       self.harness.VerifySafely(status, True,'Open the online Help  with key "<Alt> H"')
#       self.harness.AddTestComment("Close the browser with'File->Quit'")
#       selectmenuitem(frmVirtualNetworkHelp,'mnuFile;Quit')
#       wait(2)
        #5. Verify all controls in the dialog have correct tabbing order
        itemList = [btnGenerate, btnOK, btnCancel, btnHelp, cboBandwidth, txtKbps, txtPacketLoss,
         'txtLatency(ms)',cboBandwidth1, txtKbps1, txtPacketLoss1, 'txtLatency(ms)1', txtMACAddress]
        wait(2)
        status = generalInst.VerifyTabIndex(frmNetworkAdapterAdvancedSettings,itemList)
        self.harness.VerifySafely(status, True, 'Tab key is work on window: %s' % frmNetworkAdapterAdvancedSettings)
        #6. Verify all controls in the dialog have correct layout
        #7. Verify all controls in the dialog are visible and enabled
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,cboBandwidth,state.ENABLED)
        self.harness.VerifySafely(status, True,'combo box "Bandwidth" is Enabled')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtKbps,state.ENABLED)
        self.harness.VerifySafely(status, True,'text field "Kbps" is ENABLED')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtPacketLoss,state.ENABLED)
        self.harness.VerifySafely(status, True,'text field "PacketLoss" is ENABLED')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,cboBandwidth1,state.ENABLED)
        self.harness.VerifySafely(status, True,'combo box "Bandwidth1" is ENABLED')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtKbps1,state.ENABLED)
        self.harness.VerifySafely(status, True,'text field "Kbps1" is ENABLED')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,state.ENABLED)
        self.harness.VerifySafely(status, True,'text field "PacketLoss1" is ENABLED')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,txtMACAddress,state.ENABLED)
        self.harness.VerifySafely(status, True,'text field "MAC Address" is ENABLED')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,btnGenerate,state.ENABLED)
        self.harness.VerifySafely(status, True,'button Generate is ENABLED"')
        status = generalInst.VerifyState(frmNetworkAdapterAdvancedSettings,btnHelp,state.ENABLED)
        self.harness.VerifySafely(status, True,'Help button is ENABLED')
        #8. Verify all labels, text, caption in the dialog are correct
        #9. Verify MAC address generating
        click(frmNetworkAdapterAdvancedSettings,btnGenerate)
        status = bool(re.match('([a-zA-Z0-9]{2}:){5}[a-zA-Z0-9]{2}',gettextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress)))
        self.harness.VerifySafely(status, True, 'New MAC Address be created')
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnClose)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test3:
    '''
    TeamRethink10    In-Bandwidth drop down list of values
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        self.harness.SetTestDescription("In-Bandwidth drop down list of values")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        #3. Verify the list has pre-populated entries
        #4. Verify the list is sorted from slowest connection to the fastest
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (100 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (100 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "100000")
        self.harness.VerifySafely(status,True,'Kbps value is "100000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line T3 (45 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T3 (45 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "45000")
        self.harness.VerifySafely(status,True,'Kbps value is "45000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (10 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (10 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "10000")
        self.harness.VerifySafely(status,True,'Kbps value is "10000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (4 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "4000")
        self.harness.VerifySafely(status,True,'Kbps value is "4000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T1 (1.544 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "1544")
        self.harness.VerifySafely(status,True,'Kbps value is "1544"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line (192 Kbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line (192 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "192")
        self.harness.VerifySafely(status,True,'Kbps value is "192"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'ISDN 2b (128 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 2b (128 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "128")
        self.harness.VerifySafely(status,True,'Kbps value is "128"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'ISDN 1b (64 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 1b (64 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "64")
        self.harness.VerifySafely(status,True,'Kbps value is "64"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Modem (56 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (56 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "56")
        self.harness.VerifySafely(status,True,'Kbps value is "56"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Modem (28.8 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (28.8 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "28")
        self.harness.VerifySafely(status,True,'Kbps value is "28"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Modem (56 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (56 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "56")
        self.harness.VerifySafely(status,True,'Kbps value is "56"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'ISDN 1b (64 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 1b (64 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "64")
        self.harness.VerifySafely(status,True,'Kbps value is "64"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'ISDN 2b (128 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 2b (128 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "128")
        self.harness.VerifySafely(status,True,'Kbps value is "128"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line (192 Kbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line (192 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "192")
        self.harness.VerifySafely(status,True,'Kbps value is "192"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T1 (1.544 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "1544")
        self.harness.VerifySafely(status,True,'Kbps value is "1544"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (4 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "4000")
        self.harness.VerifySafely(status,True,'Kbps value is "4000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (10 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (10 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "10000")
        self.harness.VerifySafely(status,True,'Kbps value is "10000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line T3 (45 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T3 (45 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "45000")
        self.harness.VerifySafely(status,True,'Kbps value is "45000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (100 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (100 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "100000")
        self.harness.VerifySafely(status,True,'Kbps value is "100000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"Unlimited is selected")
#        self.harness.AddTestComment("Kbps value is: %s" % getvalue(frmNetworkAdapterAdvancedSettings,sbtnKbps1))##
#        status = bool(getvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == 0)
#        self.harness.VerifySafely(status,True,'Kbps value is "0"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "0")
        self.harness.VerifySafely(status,True,'Kbps value is "0"')
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnClose)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test4:
    '''
    TeamRethink35    Out-Bandwidth drop down list of values
    '''
    def __init__(self, harness):
        self.harness = harness

    def startTest(self, testdata):
        self.harness.SetTestDescription("Out-Bandwidth drop down list of values")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        #3. Verify the list has pre-populated entries
        #4. Verify the list is sorted from slowest connection to the fastest
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (100 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (100 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "100000")
        self.harness.VerifySafely(status,True,'Kbps value is "100000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line T3 (45 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T3 (45 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "45000")
        self.harness.VerifySafely(status,True,'Kbps value is "45000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (10 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (10 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "10000")
        self.harness.VerifySafely(status,True,'Kbps value is "10000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (4 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "4000")
        self.harness.VerifySafely(status,True,'Kbps value is "4000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T1 (1.544 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "1544")
        self.harness.VerifySafely(status,True,'Kbps value is "1544"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line (192 Kbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line (192 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "192")
        self.harness.VerifySafely(status,True,'Kbps value is "192"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'ISDN 2b (128 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 2b (128 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "128")
        self.harness.VerifySafely(status,True,'Kbps value is "128"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'ISDN 1b (64 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 1b (64 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "64")
        self.harness.VerifySafely(status,True,'Kbps value is "64"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Modem (56 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (56 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "56")
        self.harness.VerifySafely(status,True,'Kbps value is "56"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Up arrow key ")
        generatekeyevent('<up><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Modem (28.8 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (28.8 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "28")
        self.harness.VerifySafely(status,True,'Kbps value is "28"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Modem (56 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (56 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "56")
        self.harness.VerifySafely(status,True,'Kbps value is "56"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'ISDN 1b (64 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 1b (64 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "64")
        self.harness.VerifySafely(status,True,'Kbps value is "64"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'ISDN 2b (128 Kbps)'))
        self.harness.VerifySafely(status,True,"'ISDN 2b (128 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "128")
        self.harness.VerifySafely(status,True,'Kbps value is "128"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line (192 Kbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line (192 Kbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "192")
        self.harness.VerifySafely(status,True,'Kbps value is "192"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T1 (1.544 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "1544")
        self.harness.VerifySafely(status,True,'Kbps value is "1544"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (4 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "4000")
        self.harness.VerifySafely(status,True,'Kbps value is "4000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (10 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (10 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "10000")
        self.harness.VerifySafely(status,True,'Kbps value is "10000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line T3 (45 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T3 (45 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "45000")
        self.harness.VerifySafely(status,True,'Kbps value is "45000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (100 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (100 Mbps)' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "100000")
        self.harness.VerifySafely(status,True,'Kbps value is "100000"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"Unlimited is selected")
#        self.harness.AddTestComment("Kbps value is: %s" % getvalue(frmNetworkAdapterAdvancedSettings,sbtnKbps1))##
#        status = bool(getvalue(frmNetworkAdapterAdvancedSettings,sbtnKbps1)== 0)
#        self.harness.VerifySafely(status,True,'Kbps value is "0"')
        click('dlgNetwork Adapter Advanced Settings','btnOpen1')
        self.harness.AddTestComment("Entered the Down arrow key ")
        generatekeyevent('<down><Enter>')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "0")
        self.harness.VerifySafely(status,True,'Kbps value is "0"')
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test5:
    '''
    TeamRethink65    inOut-Bandwidth key-value pairs in vmx files
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        self.harness.SetTestDescription("inOut-Bandwidth key-value pairs in vmx files")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        testdata = getTestDataList(testdata)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM(vmName = testdata['vmname'])
        ## must edit the network advanced settings first, or there will be related params in vmx file!!!
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        # verify the default income/outcome bandwidth
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth default selected 'Unlimited'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "")
        self.harness.VerifySafely(status,True,"Incoming Transfer Kbps default selected ''")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"Outcoming Transfer bandwidth default selected 'Unlimited'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "")
        self.harness.VerifySafely(status,True,"Outcoming Transfer Kbps default selected ''")
        # set a custom setting, or there won't be params 'ethernet#.rxbw.limit (In), ethernet#.txbw.limit (Out)' in VMX file
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom')
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom')
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Save changes and close VM settings")
        click(vmSettingsWindow,btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        #key/value pairs in VMX file are properly handled: ethernet#.rxbw.limit (In), ethernet#.txbw.limit (Out)
        #
        #2. Enter valid value for the key, e.g. 4000
        #3. Enter invalid value for the key, e.g. abc
        self.harness.AddTestComment("Set the in/out-Kbps value as '4000' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"4000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"4000"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Cable (4 Mbps)'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "4000")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 4000")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"Outgoing Transferbandwidth selected 'Cable (4 Mbps)'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "4000")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 4000")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set the in/out-Kbps value as 'abc' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"abc"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"abc"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Unlimited'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 0")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Unlimited'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        #4. Enter boundary value for the key, e.g.  0, 0.5, 1,  9999999, 10000000
        #5. Enter out of bounds values, e.g. -1, 10000001
        self.harness.AddTestComment("Set the in/out-Kbps value as '0' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"0"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"0"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "0")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 0")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "0")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set the in/out-Kbps value as '0.5' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"0.5"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"0.5"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Unlimited'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 0")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Unlimited'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnClose)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set the in/out-Kbps value as '1' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"1"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"1"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "1")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 1")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings, txtKbps1)== "1")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 1")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set the in/out-Kbps value as '9999999' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"9999999"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"9999999"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "9999999")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 9999999")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "9999999")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 9999999")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set the in/out-Kbps value as '10000000' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"10000000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"10000000"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "10000000")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 10000000")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "10000000")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 10000000")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set the in/out-Kbps value as '-1' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"-1"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"-1"')
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Unlimited'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 0")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Unlimited'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set the in/out-Kbps value as '10000001' in vmx file")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"10000001"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"10000001"')
        wait(3)
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"Incoming Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "10000000")
        self.harness.VerifySafely(status,True,"Incoming Transfer kbps is 10000000")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"Outgoing Transfer bandwidth selected 'Custom'")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "10000000")
        self.harness.VerifySafely(status,True,"Outgoing Transfer kbps is 10000000")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings()
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test6:
    '''
    TeamRethink69    Mac Address contros functionality
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):

        self.harness.SetTestDescription("Mac Address contros functionality")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        testdata = getTestDataList(testdata)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        #3. Verify field "MAC Address" default value
        #4. Enter valid values into "MAC Address" field
        #5. Enter invalid values/characters into "MAC Address" field
        #6. Enter incomplete value into "MAC Address" field
        #7. Leave "MAC Address" field empty
        #8. Click "Generate" button
        #9. Modify any of  first three octets of the mac address
        #10. Verify saved MAC Address in in *.vmx file
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress) == '')
        self.harness.VerifySafely(status,True,"The default value of MAC Address is blank")

        self.harness.AddTestComment('Enter invalid values/characters into "MAC Address" field')
        generalInst.SendKeyboardInput('<Shift>1<Shift>2<Shift>3<Shift>4<Shift>5<Shift>6',frmNetworkAdapterAdvancedSettings,txtMACAddress)
        generalInst.SendKeyboardInput('<Shift>7<Shift>8<Shift>9<Shift>0<Shift>`<Shift>-<Shift>=',frmNetworkAdapterAdvancedSettings,txtMACAddress)
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress) == '')
        self.harness.VerifySafely(status,True,"Invalid value/characters can not be inputed")
        self.harness.AddTestComment('Enter incomplete value into "MAC Address" field')
        settextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress,'0050')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        self.harness.VerifySafely(status,True,"Error dialog appears")
        click(dlgQuestion,btnOK)
        self.harness.AddTestComment('Leave "MAC Address" field empty')
        settextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress,'')
        self.harness.AddTestComment("click 'Close' button'")
        click(frmNetworkAdapterAdvancedSettings,btnClose)
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = (gettextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress)== '')
        self.harness.VerifySafely(status, True, 'MAC Address is blank')
        self.harness.AddTestComment('click "Generate" button')
        click(frmNetworkAdapterAdvancedSettings,btnGenerate)
        status = bool(re.match('([a-zA-Z0-9]{2}:){5}[a-zA-Z0-9]{2}',gettextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress)))
        self.harness.VerifySafely(status, True, 'New MAC Address be generated')
        self.harness.AddTestComment('Enter valid values into "MAC Address" field')
        settextvalue(frmNetworkAdapterAdvancedSettings,txtMACAddress,'00:50:56:27:6C:6A')
        self.harness.AddTestComment('click "OK" button')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        status = (vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.address')[1] == '"00:50:56:27:6C:6A"')
        self.harness.VerifySafely(status, True, 'The MAC address be saved in vmx file')
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test7:
    '''
    TeamRethink83    Preferences-Virtual Machines page implementation
    TeamRethink84    Power On Delay control implementation
    TeamRethink85    Power On Delay default value
    TeamRethink86    Power On Delay value saving
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        self.harness.SetTestDescription("Preferences-Virtual Machines page-Power On Delay")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Open Preferences")
        selectmenuitem(mainWindow,'mnuEdit;Preferences')
        status = bool(waittillguiexist(prefWindow))
        self.harness.VerifySafely(status, True, "Preferences window opens")
        status = bool(objectexist(prefWindow, virtualmachines))
        self.harness.VerifySafely(status, True, "section *virtualmachines exists")
        status = bool(gettextvalue(prefWindow, txtSecondsbetweenpoweringonmultipleVMs)=='10')
        self.harness.VerifySafely(status, True, "Default value of the seconds between powering on multiple vms is 10" )
        generatekeyevent('<Alt>p')
        status = generalInst.VerifyState(prefWindow, txtSecondsbetweenpoweringonmultipleVMs,state.FOCUSED)
        self.harness.VerifySafely(status, True,'text field "SecondsbetweenpoweringonmultipleVMs" get focus with key "<Alt>p"')
        #Check Power On Delay control(s) 2. Power On Delay control(s) has access key, correct tabbing order, correctly handles values: min, max, valid, invalid, border
        # Check Power On Delay default value  default value is correct: 10 sec
        self.harness.AddTestComment('Set value for "SecondsbetweenpoweringonmultipleVMs" as 120')
        settextvalue(prefWindow, txtSecondsbetweenpoweringonmultipleVMs,'120')
        click(prefWindow, btnOK)
        selectmenuitem(mainWindow,'mnuEdit;Preferences')
        status = bool(waittillguiexist(prefWindow))
        self.harness.VerifySafely(status, True, "Preferences window opens")
        wait(1)
        status = bool(gettextvalue(prefWindow, txtSecondsbetweenpoweringonmultipleVMs) == '120')
        self.harness.VerifySafely(status, True, "the settings for seconds between powering on multiple vms is saved and properly loaded" )
        #2. Set Power On Delay preference and close Preferences
        #3. Close WS
        #4. Open WS->Edit->Preferences->Virtual Machines page  The prefernece is saved and properly loaded
        self.harness.AddTestComment("Close Preferences window")
        click(prefWindow,btnClose)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test8:
    '''
    TeamRethink06    NAAS dialog close options
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        '''
        1. Open "Network Adapter Advanced Settings" dialog
        2. Press <Enter> keyboard key
        3. Navigate to button "Close" and press <Enter> keyboard key
        4. Click button "Close"
        5. Click buton "X"
        6. Press keyboard key "Esc"
        7. Press keyboard keys "Alt+F4"
        8. Open the dialog's System menu and press <C> keyboard key
        '''
        self.harness.SetTestDescription("NAAS dialog close options")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        self.harness.AddTestComment("Launch Workstation")
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        self.harness.AddTestComment("click <Enter> key")
        generalInst.SendKeyboardInput("<Enter>",frmNetworkAdapterAdvancedSettings,btnOK)
        #generatekeyevent('<Enter>')
        status = bool(waittillguinotexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' OK")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("click OK button")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguinotexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' OK")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("click X button")
        click(frmNetworkAdapterAdvancedSettings, btnClose) #click "X" to close
        status = bool(waittillguinotexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' closed")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("press Esc key")
        generatekeyevent('<Esc>')
        status = bool(waittillguinotexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' closed")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("press Alt + F4 button")
        generatekeyevent('<Alt><F4>')
        status = bool(waittillguinotexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' closed")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test9:
    '''
    TeamRethink16-23   in-Kbps
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        #        Clicking Up/Down buttons in the spin box changes value in the edit field incrementally by 1
        #        Pressing Up/Down keyboard keys  changes value in the edit field incrementally by 1
        #        Pressing page Up/Down keyboard keys  changes value in the edit field incrementally by 8
        #        3.Enter "35" in "Kbps" edit field
        #        4. Enter "4000" in "Kbps" edit field
        #        5. Enter "28" in "Kbps" edit field
        #        6. Enter "1544" in "Kbps" edit field
        #        3. Value is accepted and "Custom" appears in the "Bandwidth" pop up list
        #        4. Value is accepted and "Cable (4 Mbps)" appears in the "Bandwidth" pop up list
        #        5. Value is accepted and "Modem (28.8 Kbps)" appears in the "Bandwidth" pop up list
        #        6. Value is accepted and "Leased Line T1 (1.544 Mbps)" appears in the "Bandwidth" pop up list
        #
        #        3. Enter "0" in "Kbps" edit field
        #        4. Enter "10000000" in "Kbps" edit field
        #        3. Value is accepted and "Custom" appears in the "Bandwidth" pop up list. Button "Up" is Enabled and button "Down" is disabled.
        #        4. Value is accepted and "Custom" appears in the "Bandwidth" pop up list. Button "Up" is disabled and button "Down" is enabled
        #
        #        3. Enter any alphabetical characters in "Kbps" edit field, e.g. "abc"
        #        4. Enter any not alphabetical characters in "Kbps" edit field, e.g. "_^+", other than numbers
        #        5. Leave edit field empty
        #        3. Unable to enter  alphabetical characters
        #        4. Unable to enter not alphabetical characters, other than numbers
        #        5. Value "0" appears in the field, after moving focus from the spin box
        #
        #        3. Enter "1" in "Kbps" edit field
        #        4. Enter "10000001" in "Kbps" edit field
        #        5. Enter "9999999" in "Kbps" edit field
        #
        #        3. Try to enter max number of characters
        #        3. Can enter only 8 characters       
        self.harness.SetTestDescription("in-Kbps functionality")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "")
        self.harness.VerifySafely(status, True, "Default value for in-Kbps is blank")
        self.harness.AddTestComment("select 'Custom' in Bandwidth combox'")
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom')
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "0")
        self.harness.VerifySafely(status, True, "The value for in-Kbps is 0")
        #self.harness.AddTestComment("clicking up/down button of txtKbps")
        #click(frmNetworkAdapterAdvancedSettings,'btnMore)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "1")
        #self.harness.VerifySafely(status, True, "click up button will increase value for in-Kbps: 1")
        #click(frmNetworkAdapterAdvancedSettings,btnLess)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "0")
        #self.harness.VerifySafely(status, True, "click down button will decrease value for in-Kbps: 0")
        generalInst.SendKeyboardInput('<UP>',frmNetworkAdapterAdvancedSettings,txtKbps)

        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "1")
        self.harness.VerifySafely(status, True, "click up key will increase value for in-Kbps: 1")
        generalInst.SendKeyboardInput('<Down>',frmNetworkAdapterAdvancedSettings,txtKbps)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "0")
        self.harness.VerifySafely(status, True, "click down key will decrease value for in-Kbps: 0")
        #<PageUp> and <PageDown> cann't change Kpbs value in Windows.
        #generalInst.SendKeyboardInput('<PageUp>',frmNetworkAdapterAdvancedSettings,txtKbps)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "8")
        #self.harness.VerifySafely(status, True, "click PageUP key will increase value for in-Kbps: 8")
        #generalInst.SendKeyboardInput('<PageDown>',frmNetworkAdapterAdvancedSettings,txtKbps)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "0")
        #self.harness.VerifySafely(status, True, "click PageDown key will decrease value for in-Kbps: 8")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'35')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'4000')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (4 Mbps)' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'28')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Modem (28.8 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (28.8 Kbps)' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'1544')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T1 (1.544 Mbps)' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'0')#? cannot verify down button is disabled
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'10000000')#? cannot verify up button is disabled
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        deletetext(frmNetworkAdapterAdvancedSettings,txtKbps,0,8)
        generalInst.SendKeyboardInput('abc',frmNetworkAdapterAdvancedSettings,txtKbps)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of Kbps as 'abc'")
        generalInst.SendKeyboardInput('<Shift>-<Shift>6<Shift>=',frmNetworkAdapterAdvancedSettings,txtKbps)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of Kbps as '_^+'")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'1')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        
        deletetext(frmNetworkAdapterAdvancedSettings,txtKbps,0,8) 
        generalInst.SendKeyboardInput('100000001',frmNetworkAdapterAdvancedSettings,txtKbps)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "10000000")
        self.harness.VerifySafely(status,True,"get'10000000' when input '100000001'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'9999999')
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps)== "9999999")
        self.harness.VerifySafely(status,True,"get'9999999' when input '9999999'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")

        deletetext(frmNetworkAdapterAdvancedSettings,txtKbps,0,8)
        generalInst.SendKeyboardInput('123456789',frmNetworkAdapterAdvancedSettings,txtKbps)
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        self.harness.VerifySafely(status,True,"maximum 8 characters can be inputed in Kbps field")
        click(dlgQuestion,btnOK)
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps,'1')
        self.harness.AddTestComment('click "OK" button')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()        
class test10:
    '''
    TeamRethink25-31   In-PacketLoss
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        #2. Click Up/Down arrow buttons in the spin box "Packet Loss"
        #2. Clicking Up/Down buttons in the spin box changes value in the edit field incrementally by 0.1
        #
        #3. Press Up/Down arrow keyboard keys
        #3. Pressing Up/Down keyboard keys  changes value in the edit field incrementally by 0.1
        #
        #3. Press PageUp/PageDown arrow keyboard keys
        #3. Pressing PageUp/PageDown keyboard keys  changes value in the edit field incrementally by 1 
        #
        #3. Enter "7.5" in "Packet Loss" edit field
        #4. Enter "4000" in "Packet Loss" edit field
        #5. Enter "28" in "Packet Loss" edit field
        #6. Enter "1.544" in "Packet Loss" edit field
        #3. Value is accepted and Up/Down buttons of the spin box become enabled
        #4. Value converted to "100.0" (mas allowed) and Up button becomes disabled
        #5. Value is accepted as "28.0" and Up/Down buttons become enabled
        #6. Value is accepted as "1.5" (only 1 decimal digit is allowed) and Up/Down buttons become enabled
        #
        #3. Enter "0" in "Packet Loss" edit field
        #4. Enter "10000000" in "Packet Loss" edit field
        #3. Value is accepted as "0.0" and button Up is enabled and button Down is disabled.
        #4. Value is accepted as "100.0" (max allowed) and button Up is disabled and button Down is enabled.
        #
        #3. Enter any alphabetical characters in "PacketLoss" edit field, e.g. "abc"
        #4. Enter any not alphabetical characters in "PacketLoss" edit field, e.g. "_^+", other than numbers
        #5. Leave edit field empty
        #3. Unable to enter  alphabetical characters
        #4. Unable to enter not alphabetical characters, other than numbers
        #5. Value "0.0" appears in the field, after moving focus from the spin box
        #
        #3. Enter "0.1" in "Packet Loss" edit field
        #4. Enter "100.1" in "Packet Loss" edit field
        #5. Enter "99.9" in "Packet Loss" edit field
        #6. Enter "-0.1" in "Packet Loss" edit field
        self.harness.SetTestDescription("Mac Address contros functionality")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        testdata = getTestDataList(testdata)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.0")
        self.harness.VerifySafely(status, True, "Default value for PacketLoss is 0.0")
        # by clicking up/down button
        #        click(frmNetworkAdapterAdvancedSettings,btn**)
        #        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == 0.1)
        #        self.harness.VerifySafely(status, True, "click up button will increase value for In-PacketLoss: 0.1")
        #        click(frmNetworkAdapterAdvancedSettings,btn**)
        #        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,stxtPacketLoss) == 0.1)
        #        self.harness.VerifySafely(status, True, "click down button will decrease value for In-PacketLoss: 0.1")
        generalInst.SendKeyboardInput('<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "1.0")
        self.harness.VerifySafely(status, True, "click up key will increase value for In-PacketLoss: 1.0")
        generalInst.SendKeyboardInput('<Down>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.0")
        self.harness.VerifySafely(status, True, "click down key will decrease value for In-PacketLoss: 0.0")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'7.5')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "7.5")
        self.harness.VerifySafely(status,True," input '7.5' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'4000')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True," input '4000' is not accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'28')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "28.0")
        self.harness.VerifySafely(status,True," input '28' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'1.544')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "1.5")
        self.harness.VerifySafely(status,True," input '1.544' will use '1.5'")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'0')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.0")
        self.harness.VerifySafely(status,True," input '0' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'10000000')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True," input '10000000' is not accepted")

        deletetext(frmNetworkAdapterAdvancedSettings,txtPacketLoss,0,8)
        generalInst.SendKeyboardInput('abc',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of In-PacketLoss as 'abc'")

        generalInst.SendKeyboardInput('<Shift>-<Shift>6<Shift>=',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of In-PacketLoss as special characters '_^+'")

        deletetext(frmNetworkAdapterAdvancedSettings,txtPacketLoss,0,5)
        self.harness.AddTestComment("click 'OK' button set the value of In-PacketLoss as empty")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True,"Cannot set the value of In-PacketLoss as empty")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'0.1')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.1")
        self.harness.VerifySafely(status,True," input '0.1' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'100.1')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True," input '100.1' is not accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'99.9')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "99.9")
        self.harness.VerifySafely(status,True," input '99.9' is accepted'")

        deletetext(frmNetworkAdapterAdvancedSettings,txtPacketLoss,0,5)
        generalInst.SendKeyboardInput('-0.1',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss)== "0.1")
        self.harness.VerifySafely(status,True,"Cannot set the value of In-PacketLoss as '-0.1'")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'0.0')
        self.harness.AddTestComment('click "OK" button')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test11:
    '''
    TeamRethink41-48   out-Kbps
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        #        Clicking Up/Down buttons in the spin box changes value in the edit field incrementally by 1
        #        Pressing Up/Down keyboard keys  changes value in the edit field incrementally by 1
        #        Pressing page Up/Down keyboard keys  changes value in the edit field incrementally by 8
        #        3.Enter "35" in "Kbps" edit field
        #        4. Enter "4000" in "Kbps" edit field
        #        5. Enter "28" in "Kbps" edit field
        #        6. Enter "1544" in "Kbps" edit field
        #        3. Value is accepted and "Custom" appears in the "Bandwidth" pop up list
        #        4. Value is accepted and "Cable (4 Mbps)" appears in the "Bandwidth" pop up list
        #        5. Value is accepted and "Modem (28.8 Kbps)" appears in the "Bandwidth" pop up list
        #        6. Value is accepted and "Leased Line T1 (1.544 Mbps)" appears in the "Bandwidth" pop up list
        #
        #        3. Enter "0" in "Kbps" edit field
        #        4. Enter "10000000" in "Kbps" edit field
        #        3. Value is accepted and "Custom" appears in the "Bandwidth" pop up list. Button "Up" is Enabled and button "Down" is disabled.
        #        4. Value is accepted and "Custom" appears in the "Bandwidth" pop up list. Button "Up" is disabled and button "Down" is enabled
        #
        #        3. Enter any alphabetical characters in "Kbps" edit field, e.g. "abc"
        #        4. Enter any not alphabetical characters in "Kbps" edit field, e.g. "_^+", other than numbers
        #        5. Leave edit field empty
        #        3. Unable to enter  alphabetical characters
        #        4. Unable to enter not alphabetical characters, other than numbers
        #        5. Value "0" appears in the field, after moving focus from the spin box
        #
        #        3. Enter "1" in "Kbps" edit field
        #        4. Enter "10000001" in "Kbps" edit field
        #        5. Enter "9999999" in "Kbps" edit field
        #
        #        3. Try to enter max number of characters
        #        3. Can enter only 8 characters
        self.harness.SetTestDescription("Out-Kbps functionality")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "")
        self.harness.VerifySafely(status, True, "Default value for out-Kbps is blank")
        self.harness.AddTestComment("select 'Custom' in Bandwidth combox'")
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom')
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "0")
        self.harness.VerifySafely(status, True, "The value for out-Kbps is 0")
        #self.harness.AddTestComment("clicking up/down button of txtKbps1")
        #click(frmNetworkAdapterAdvancedSettings,'btnMore)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "1")
        #self.harness.VerifySafely(status, True, "click up button will increase value for out-Kbps: 1")
        #click(frmNetworkAdapterAdvancedSettings,btnLess)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "0")
        #self.harness.VerifySafely(status, True, "click down button will decrease value for out-Kbps: 0")
        generalInst.SendKeyboardInput('<UP>',frmNetworkAdapterAdvancedSettings,txtKbps1)

        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "1")
        self.harness.VerifySafely(status, True, "click up key will increase value for out-Kbps: 1")
        generalInst.SendKeyboardInput('<Down>',frmNetworkAdapterAdvancedSettings,txtKbps1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "0")
        self.harness.VerifySafely(status, True, "click down key will decrease value for out-Kbps: 0")
        #<PageUp> and <PageDown> cann't change Kpbs value in Windows.
        #generalInst.SendKeyboardInput('<PageUp>',frmNetworkAdapterAdvancedSettings,txtKbps1)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "8")
        #self.harness.VerifySafely(status, True, "click PageUP key will increase value for out-Kbps: 8")
        #generalInst.SendKeyboardInput('<PageDown>',frmNetworkAdapterAdvancedSettings,txtKbps1)
        #status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "0")
        #self.harness.VerifySafely(status, True, "click PageDown key will decrease value for out-Kbps: 8")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'35')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'4000')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"'Cable (4 Mbps)' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'28')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Modem (28.8 Kbps)'))
        self.harness.VerifySafely(status,True,"'Modem (28.8 Kbps)' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'1544')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"'Leased Line T1 (1.544 Mbps)' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'0')#? cannot verify down button is disabled
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'10000000')#? cannot verify up button is disabled
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        deletetext(frmNetworkAdapterAdvancedSettings,txtKbps1,0,8)
        generalInst.SendKeyboardInput('abc',frmNetworkAdapterAdvancedSettings,txtKbps1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of Kbps1 as 'abc'")
        generalInst.SendKeyboardInput('<Shift>-<Shift>6<Shift>=',frmNetworkAdapterAdvancedSettings,txtKbps1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of Kbps as '_^+'")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'1')
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        deletetext(frmNetworkAdapterAdvancedSettings,txtKbps1,0,8) 
        generalInst.SendKeyboardInput('100000001',frmNetworkAdapterAdvancedSettings,txtKbps1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "10000000")
        self.harness.VerifySafely(status,True,"get'10000000' when input '100000001'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'9999999')
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1)== "9999999")
        self.harness.VerifySafely(status,True,"get'9999999' when input '9999999'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"'Custom' is selected")
        deletetext(frmNetworkAdapterAdvancedSettings,txtKbps1,0,8)
        generalInst.SendKeyboardInput('123456789',frmNetworkAdapterAdvancedSettings,txtKbps1)
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        self.harness.VerifySafely(status,True,"maximum 8 characters can be inputed in Kbps field")
        click(dlgQuestion,btnOK)
        settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1,'1')
        self.harness.AddTestComment('click "OK" button')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()

class test12:
    '''
    TeamRethink50-56   out-PacketLoss
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        #2. Click Up/Down arrow buttons in the spin box "Packet Loss"
        #2. Clicking Up/Down buttons in the spin box changes value in the edit field incrementally by 0.1
        #
        #3. Press Up/Down arrow keyboard keys
        #3. Pressing Up/Down keyboard keys  changes value in the edit field incrementally by 0.1
        #
        #3. Press PageUp/PageDown arrow keyboard keys
        #3. Pressing PageUp/PageDown keyboard keys  changes value in the edit field incrementally by 1 
        #
        #3. Enter "7.5" in "Packet Loss" edit field
        #4. Enter "4000" in "Packet Loss" edit field
        #5. Enter "28" in "Packet Loss" edit field
        #6. Enter "1.544" in "Packet Loss" edit field
        #3. Value is accepted and Up/Down buttons of the spin box become enabled
        #4. Value converted to "100.0" (mas allowed) and Up button becomes disabled
        #5. Value is accepted as "28.0" and Up/Down buttons become enabled
        #6. Value is accepted as "1.5" (only 1 decimal digit is allowed) and Up/Down buttons become enabled
        #
        #3. Enter "0" in "Packet Loss" edit field
        #4. Enter "10000000" in "Packet Loss" edit field
        #3. Value is accepted as "0.0" and button Up is enabled and button Down is disabled.
        #4. Value is accepted as "100.0" (max allowed) and button Up is disabled and button Down is enabled.
        #
        #3. Enter any alphabetical characters in "PacketLoss" edit field, e.g. "abc"
        #4. Enter any not alphabetical characters in "PacketLoss" edit field, e.g. "_^+", other than numbers
        #5. Leave edit field empty
        #3. Unable to enter  alphabetical characters
        #4. Unable to enter not alphabetical characters, other than numbers
        #5. Value "0.0" appears in the field, after moving focus from the spin box
        #
        #3. Enter "0.1" in "Packet Loss" edit field
        #4. Enter "100.1" in "Packet Loss" edit field
        #5. Enter "99.9" in "Packet Loss" edit field
        #6. Enter "-0.1" in "Packet Loss" edit field
        self.harness.SetTestDescription("Mac Address contros functionality")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        testdata = getTestDataList(testdata)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.0")
        self.harness.VerifySafely(status, True, "Default value for PacketLoss is 0.0")
        generalInst.SendKeyboardInput('<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "1.0")
        self.harness.VerifySafely(status, True, "click up key will increase value for Out-PacketLoss: 1.0")
        generalInst.SendKeyboardInput('<Down>',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.0")
        self.harness.VerifySafely(status, True, "click down key will decrease value for Out-PacketLoss: 0.0")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'7.5')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "7.5")
        self.harness.VerifySafely(status,True," input '7.5' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'4000')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True," input '4000' is not accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'28')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "28.0")
        self.harness.VerifySafely(status,True," input '28' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'1.544')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "1.5")
        self.harness.VerifySafely(status,True," input '1.544' will use '1.5'")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'0')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.0")
        self.harness.VerifySafely(status,True," input '0' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'10000000')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True," input '10000000' is not accepted")

        deletetext(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,0,8)
        generalInst.SendKeyboardInput('abc',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of Out-PacketLoss as 'abc'")

        generalInst.SendKeyboardInput('<Shift>-<Shift>6<Shift>=',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1)== "")
        self.harness.VerifySafely(status,True,"Cannot set the value of Out-PacketLoss as special characters '_^+'")
        deletetext(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,0,5)
        self.harness.AddTestComment("click 'OK' button set the value of Out-PacketLoss as empty")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True,"Cannot set the value of Out-PacketLoss as empty")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'0.1')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.1")
        self.harness.VerifySafely(status,True," input '0.1' is accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'100.1')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True," input '100.1' is not accepted")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'99.9')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        settingsInst.CloseVMSettings(btnOK)
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "99.9")
        self.harness.VerifySafely(status,True," input '99.9' is accepted'")

        deletetext(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,0,5)
        generalInst.SendKeyboardInput('-0.1',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1)== "0.1")
        self.harness.VerifySafely(status,True,"Cannot set the value of Out-PacketLoss as '-0.1'")
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'0.0')
        self.harness.AddTestComment('click "OK" button')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()  

class test13:
    '''
    TeamRethink58   PacketLoss and Bandwidth modification in VM Settings
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
#1. Enter/Modify the pocket loss and bandwidth values in VM Settings Wizard. For exmaple:
#Incoming - 
#   Bandwidth: ISDN 2b (128 Kbps)
#   Kbps: 128
#   Packet Loss (%): 20.0
#Outgoing -
#   Bandwidth: Cable (100 Mbps)
#   Kbps: 100000
#   Packet Loss (%): 15.5
#
#2. Proper keys and values are generated/changed in the VMX file. For example:
#   ethernet0.txfi.droprate = "155"
#   ethernet0.rxfi.droprate = "200"
#   ethernet0.txfi.dropsize = "1"
#   ethernet0.rxfi.dropsize = "1"
#   ethernet0.txbw.limit = "100000"
#   ethernet0.rxbw.limit = "128"
        self.harness.SetTestDescription("PacketLoss and Bandwidth modification in VM Settings")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        testdata = getTestDataList(testdata)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'ISDN 2b (128 Kbps)')
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'20.0')
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (100 Mbps)')
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'15.5')
        self.harness.AddTestComment('click "OK" button')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        status = (vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate')[1] == '"200"')
        self.harness.VerifySafely(status, True, 'The In-PacketLoss value: 200')
        status = (vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate')[1] == '"155"')
        self.harness.VerifySafely(status, True, 'The Out-PacketLoss value: 155')
        status = (vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.dropsize')[1] == '"1"')
        self.harness.VerifySafely(status, True, 'The In-PacketLoss dropsize: 1')
        status = (vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.dropsize')[1] == '"1"')
        self.harness.VerifySafely(status, True, 'The Out-PacketLoss dropsize: 1')
        status = (vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit')[1] == '"128"')
        self.harness.VerifySafely(status, True, 'The In-Kbps value: 128')
        status = (vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit')[1] == '"100000"')
        self.harness.VerifySafely(status, True, 'The Out-Kbps value: 100000')
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test14:
    '''
    TeamRethink66   inOut-PacketLoss key-value pairs in vmx files
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
#the packet loss key/value pairs in VMX file are properly handled:
#ehternet#.rxfi.droprate (In)
#ehternet#.txfi.droprate (Out)
#ehternet#.rxfi.dropsize (In)
#ehternet#.txfi.dropsize (Out)
#
#2. Enter valid value for the key, e.g. 155, 1738
#3. Enter invalid value for the key, e.g. abc, -1, 0.1
#4. Enter boundary value for the key, e.g. 0, 1, 999, 1000
#5. Enter out of bounds values, e.g. 10000000
#6. Verify dropsize values in the *.vmx file
#
#2. Value is accepted and VM function properly - 
#Packet Loss (%): 15.5, 100.0
#3. Values are handled properly: keys don't break anything and fall back to reasonable defaults -
#Packet Loss (%): 0.0, 0.0, 0.0
#4. Value is accepted and VMs function properly - 
#Packet Loss (%): 0.0, 0.1, 99.9, 100.0
#5. Values are handled properly:
#Packet Loss (%): 100.0
#6. The value set to "1" for incoming and outgoing traffics
        self.harness.SetTestDescription("inOut-PacketLoss key-value pairs in vmx files")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        testdata = getTestDataList(testdata)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        # set a custom setting, or there won't be params 'ethernet#.rxbw.limit (In), ethernet#.txbw.limit (Out)' in VMX file
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'1')
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'1')
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        status = bool(vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate')[1] == '"10"')
        self.harness.VerifySafely(status, True, 'The In-PacketLoss value: 10')
        status = bool(vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate')[1] == '"10"')
        self.harness.VerifySafely(status, True, 'The Out-PacketLoss value: 10')
        status = bool(vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.dropsize')[1] == '"1"')
        self.harness.VerifySafely(status, True, 'The In-PacketLoss dropsize: 1')
        status = bool(vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.dropsize')[1] == '"1"')
        self.harness.VerifySafely(status, True, 'The Out-PacketLoss dropsize: 1')        
        self.harness.AddTestComment("Set inOut-PacketLoss value as 155 in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"155"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"155"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "15.5")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 15.5")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "15.5")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 15.5")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '1738' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"1738"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"1738"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "100.0")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 100")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "100.0")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 100")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as 'abc' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"abc"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"abc"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.0")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 0")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.0")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '-1' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"-1"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"-1"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.0")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 0")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.0")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '0.1' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"0.1"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"0.1"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.0")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 0")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.0")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '0' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"0"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"0"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.0")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 0")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.0")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 0")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnClose)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '1' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"1"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"1"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "0.1")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 0.1")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "0.1")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 0.1")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '999' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"999"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"999"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "99.9")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 99.9")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "99.9")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 99.9")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '1000' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"1000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"1000"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "100.0")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 100")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "100.0")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 100")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-PacketLoss value as '10000000' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxfi.droprate','"10000000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txfi.droprate','"10000000"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "100.0")
        self.harness.VerifySafely(status,True,"The In-PacketLoss is 100")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "100.0")
        self.harness.VerifySafely(status,True,"The Out-PacketLoss is 100")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test15:
    '''
    TeamRethink67   inOut-Kbps key-value pairs in vmx files
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        #the Kbps key/value pairs in VMX file are properly handled: ehternet#.rxfi.dropsize (In), ehternet#.txfi.dropsize (Out)
        #
        # abc, -1, 0.1,0,9999999,10000000,10000001
        # 100000,45000,10000,4000,1544,192,128,64,56,28
        self.harness.SetTestDescription("inOut-Kbps key-value pairs in vmx files")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        testdata = getTestDataList(testdata)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        # set a custom setting, or there won't be params 'ethernet#.rxbw.limit (In), ethernet#.txbw.limit (Out)' in VMX file
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom')
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom')
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        status = bool(vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit')[1] == '"0"')
        self.harness.VerifySafely(status, True, 'The In-Kbps value in vmx: 0')
        status = bool(vmInst.GetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit')[1] == '"0"')
        self.harness.VerifySafely(status, True, 'The Out-Kbps value in vmx: 0')
        self.harness.AddTestComment("Set inOut-Kbps value as 'abc' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"abc"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"abc"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Unlimited'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Unlimited'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '-1' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"-1"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"-1"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Unlimited'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Unlimited'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '0.1' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"0.1"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"0.1"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Unlimited'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Unlimited'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Unlimited'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Unlimited'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '0' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"0"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"0"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "0")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'0'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "0")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'0'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '9999999' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"9999999"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"9999999"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "9999999")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'9999999'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "9999999")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'9999999'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '10000000' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"10000000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"10000000"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "10000000")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'10000000'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "10000000")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'10000000'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '10000001' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"10000001"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"10000001"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "10000000")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'10000000'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Custom'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Custom'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "10000000")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'10000000'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '100000' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"100000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"100000"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (100 Mbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Cable (100 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "100000")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'100000'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (100 Mbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Cable (100 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "100000")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'100000'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '45000' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"45000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"45000"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line T3 (45 Mbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Leased Line T3 (45 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "45000")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'45000'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line T3 (45 Mbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Leased Line T3 (45 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "45000")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'45000'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '10000' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"10000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"10000"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (10 Mbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Cable (10 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "10000")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'10000'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (10 Mbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Cable (10 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "10000")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'10000'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '4000' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"4000"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"4000"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Cable (4 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "4000")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'4000'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Cable (4 Mbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Cable (4 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "4000")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'4000'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '1544' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"1544"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"1544"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Leased Line T1 (1.544 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "1544")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'1544'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line T1 (1.544 Mbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Leased Line T1 (1.544 Mbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "1544")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'1544'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '192' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"192"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"192"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Leased Line (192 Kbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Leased Line (192 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "192")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'192'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Leased Line (192 Kbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Leased Line (192 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "192")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'192'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '128' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"128"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"128"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'ISDN 2b (128 Kbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'ISDN 2b (128 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "128")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'128'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'ISDN 2b (128 Kbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'ISDN 2b (128 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "128")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'128'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '64' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"64"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"64"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'ISDN 1b (64 Kbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'ISDN 1b (64 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "64")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'64'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'ISDN 1b (64 Kbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'ISDN 1b (64 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "64")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'64'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '56' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"56"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"56"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Modem (56 Kbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Modem (56 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "56")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'56'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Modem (56 Kbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Modem (56 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "56")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'56'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Close VM")
        vmInst.CloseVM(testdata['vmname'])
        self.harness.AddTestComment("Set inOut-Kbps value as '28' in vmx file ")
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.rxbw.limit','"28"')
        vmInst.SetVMXValue(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'],'ethernet0.txbw.limit','"28"')
        self.harness.AddTestComment("Open VM")
        vmInst.OpenVM(vmInst.testvmDir,testdata['vmname'],'%s.vmx'%testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Modem (28.8 Kbps)'))
        self.harness.VerifySafely(status,True,"The Incoming Bandwidth is 'Modem (28.8 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps) == "28")
        self.harness.VerifySafely(status,True,"The value for In-Kbps is'28'")
        status = bool(verifyselect(frmNetworkAdapterAdvancedSettings,cboBandwidth1,'Modem (28.8 Kbps)'))
        self.harness.VerifySafely(status,True,"The Outcoming Bandwidth is 'Modem (28.8 Kbps)'")
        status = bool(gettextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1) == "28")
        self.harness.VerifySafely(status,True,"The value for Out-Kbps is'28'")
        self.harness.AddTestComment("Close window 'Network Adapter Advanced Settings'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()
class test16:
    '''
    TeamRethink07   NAAS dialog help
    '''
    def __init__(self, harness):
        self.harness = harness
    def startTest(self, testdata):
        #2. Navigate to button "Help" and press <Enter> keyboard keys
        #3. Click button "Help"
        #4. Press <Alt + H> keyboard keys
        #
        # Browser with appropreate Help article will come up in all cases
        #
        self.harness.SetTestDescription("NAAS dialog help")
        vmInst = VM(self.harness)
        generalInst = GeneralActions(self.harness)
        settingsInst = Settings(self.harness)
        vmInst.LaunchWorkstation()
        self.harness.AddTestComment("Create a new VM")
        vmInst.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        settingsInst.OpenVMSettings()
        status = bool(selecttab(vmSettingsWindow,'ptl0','Hardware'))
        self.harness.VerifySafely(status,True,"Open VM Settings->Hardware tab")
        status = bool(selectrow(vmSettingsWindow,'lst0','Network Adapter*'))
        self.harness.VerifySafely(status,True,"Select Network Adapter")
        status = generalInst.VerifyState(vmSettingsWindow,btnAdvancedNet,'ENABLED')
        self.harness.VerifySafely(status,True,"Advanced button enabled.")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        self.harness.AddTestComment("Verify the Help button works.")
        generalInst.VerifyHelpButton(frmNetworkAdapterAdvancedSettings, btnHelp, txtVirtualNetworkHelp, "<f1>")
        self.harness.AddTestComment('click "OK" button')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        settingsInst.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        vmInst.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        vmInst.CloseWorkstation()
    def endTest(self):
        self.harness.UpdateTestcaseResult()


class generalCase(object):
    def __init__(self, harness):
        self.harness = harness
        self.vmInstance = VM(self.harness)
        self.generalInstance = GeneralActions(self.harness)
        self.settingsInstance = Settings(self.harness)
        self.vmInstance.LaunchWorkstation()

    def openAdvancedNet(self):
        self.settingsInstance.OpenVMSettings()
        self.settingsInstance.SelectSettingsHardware(
            vmSettingsWindow, 'lstNetworkAdapter')
        click(vmSettingsWindow, btnAdvancedNet)

    def closeNAAS(self):
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)

    def openNAAS(self):
        self.settingsInstance.OpenVMSettings()
        self.settingsInstance.SelectSettingsHardware(
            vmSettingsWindow, "lstNetworkAdapter")
        click(vmSettingsWindow,btnAdvancedNet)

    def endTest(self):
        self.harness.UpdateTestcaseResult()

class test18(generalCase):

    def startTest(self, testdata):
        self.harness.SetTestDescription(
            "Button Advnaced in the VM Settings Network Adapter panel")
        self.harness.AddTestComment("Create a new VM")
        self.vmInstance.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        self.settingsInstance.OpenVMSettings()
        self.settingsInstance.SelectSettingsHardware(
         vmSettingsWindow, lstNetworkAdapter)
        status = self.generalInstance.VerifyState(
            vmSettingsWindow, btnAdvancedNet, "ENABLED")
        self.harness.VerifySafely(status, True, "Advanced button enabled")
        # check access key "V"
        self.generalInstance.SendKeyboardInput('<alt>V', vmSettingsWindow,btnOK)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(
            status,True,"Dialog 'NetWork Adapter Advanced Settings' Opens")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        # correct tab order
        itemList = [chkConnectatpoweronwin,
                    rbtnNATUsedtosharethehostsIPaddress,
                    btnLANSegments,
                    btnAdvanced,
                    btnAdd,
                    btnRemove,
                    btnOK,
                    btnCancel,
                    btnHelp,
                    ptabHardware,
                    lstNetworkAdapter]
        status = self.generalInstance.VerifyTabIndex(vmSettingsWindow, itemList)
        self.harness.VerifySafely(
            status, True, 'Tab key is work on window: %s' % vmSettingsWindow)
        #  correct layout
        items = [chkConnectatpoweronwin,
                rbtnNATUsedtosharethehostsIPaddress,
                btnLANSegments,
                btnAdvanced,
                btnAdd,
                btnRemove,
                btnOK,
                btnCancel,
                btnHelp,
                ptabHardware,
                lstNetworkAdapter
                ]
        for item in items:
            status = self.generalInstance.VerifyState(
                vmSettingsWindow, item, state.ENABLED)
            self.harness.VerifySafely(
                status, True,'combo box %s is Enabled' % item)

        self.settingsInstance.CloseVMSettings()
        self.harness.AddTestComment("Delete VM")
        self.vmInstance.DeleteVM()
        self.harness.AddTestComment("Close Workstation")
        self.vmInstance.CloseWorkstation()


class test19(generalCase):

    def startTest(self, testdata):
        self.harness.SetTestDescription(
            "In-Bandwidth drop down selected values")
        self.harness.AddTestComment("Create a new VM")
        testdata = getTestDataList(testdata)
        self.vmInstance.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        self.settingsInstance.OpenVMSettings()
        self.settingsInstance.SelectSettingsHardware(
        vmSettingsWindow, "lstNetworkAdapter")
        click(vmSettingsWindow, btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(
            status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        click(frmNetworkAdapterAdvancedSettings,btnOpen)
        comboselect(
            frmNetworkAdapterAdvancedSettings,cboBandwidth,"Cable (4 Mbps)")
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtKbps) == "4000")
        self.harness.VerifySafely(
            status, True, "The value for in-Kbps is 4000")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        self.settingsInstance.CloseVMSettings(btnOK)
        status = (self.vmInstance.GetVMXValue(
            self.vmInstance.testvmDir,testdata['vmname'],
            '%s.vmx'%testdata['vmname'],
            'ethernet0.rxbw.limit')[1] == '"4000"')
        self.harness.VerifySafely(status, True, 'The in-Kbps value: 4000')
        self.harness.AddTestComment("Delete VM")
        self.vmInstance.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        self.vmInstance.CloseWorkstation()


class test20(generalCase):

    def startTest(self, testdata):
        self.harness.SetTestDescription(
            "In-Kbps spin box mouse click value selection")
        self.harness.AddTestComment("Create a new VM")
        testdata = getTestDataList(testdata)
        self.vmInstance.CreateNewVM(vmName=testdata['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        self.openNAAS()
        self.harness.AddTestComment("select 'Custom' in Bandwidth combox")
        comboselect(frmNetworkAdapterAdvancedSettings,cboBandwidth,'Custom')
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtKbps) == "0")
        self.harness.VerifySafely(status, True, "The value for in-Kbps is 0")

        # click UP to increase value
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtKbps)
        self.closeNAAS()
        status = (self.vmInstance.GetVMXValue(
            self.vmInstance.testvmDir,testdata['vmname'],
            '%s.vmx'%testdata['vmname'],
            'ethernet0.rxbw.limit')[1] == '"1"')
        self.harness.VerifySafely(status, True, 'The in-Kbps value: 1')
        self.openNAAS()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtKbps) == "1")
        self.harness.VerifySafely(
            status, True, "click UP key will increment the value by 1")

        # click down to decrease value
        self.generalInstance.SendKeyboardInput(
            '<Down>',frmNetworkAdapterAdvancedSettings,txtKbps)
        self.closeNAAS()
        status = (self.vmInstance.GetVMXValue(
            self.vmInstance.testvmDir,testdata['vmname'],
            '%s.vmx'%testdata['vmname'],
            'ethernet0.rxbw.limit')[1] == '"0"')
        self.harness.VerifySafely(status, True, 'The in-Kbps value: 0')
        self.openNAAS()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtKbps) == "0")
        self.harness.VerifySafely(
            status, True, "click DOWN will decrement the value by 1")

        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings()
        self.harness.AddTestComment("Delete VM")
        self.vmInstance.DeleteVM()
        self.harness.AddTestComment("Close Workstation")
        self.vmInstance.CloseWorkstation()


class test21(generalCase):

    def VMXVerify(self, checkedValue):
        packetLoss = self.vmInstance.GetVMXValue(
            self.vmInstance.testvmDir, self.testdatadict['vmname'],
             '%s.vmx' % self.testdatadict['vmname'],
            'ethernet0.rxfi.droprate')[1]
        status = (int(packetLoss.strip('"')) == checkedValue * 10)
        self.harness.VerifySafely(status, True,
            'The packet loss %% is %s' % checkedValue)

    def startTest(self, testdata):

        self.harness.SetTestDescription(
            "In-PacketLoss valid values")
        self.harness.AddTestComment("Create a new VM")
        self.testdatadict = getTestDataList(testdata)
        self.vmInstance.CreateNewVM(vmName=self.testdatadict['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        self.openAdvancedNet()

        # Enter 7.5, value accepted and buttons enabled
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'7.5')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(7.5)
        self.openAdvancedNet()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "7.5")
        self.harness.VerifySafely(status,True," input '7.5' is accepted")
        # test UP button
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(8.0)
        self.openAdvancedNet()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "8.0")
        self.harness.VerifySafely(
            status, True,
            "input 8.0,and Value accepted and Up/Down enabled")

        # Enter 4000, value not accepted and down button enabled, up disabled
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'4000')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        click(dlgQuestion,btnOK)
        self.harness.VerifySafely(status,True," input '4000' is not accepted")
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(100)
        self.openAdvancedNet()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "100.0")
        self.harness.VerifySafely(status, True, "value converted to 100.0")
        # check UP button disabled
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "100.0")
        self.harness.VerifySafely(status, True, "Up button is disabled")
        # check DOWN button enabled
        self.generalInstance.SendKeyboardInput(
            '<DOWN>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "99.0")
        self.harness.VerifySafely(status, True, "Down button is enabled")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(99)
        self.openAdvancedNet()

        # Enter 28, valued converted and buttons enabled
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'28')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(28)
        self.openAdvancedNet()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "28.0")
        self.harness.VerifySafely(
            status,True," input '28' is converted 28.0")
        # check UP button
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(29)
        self.openAdvancedNet()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "29.0")
        self.harness.VerifySafely
        (status, True, " Up/Down buttons  become enabled")

        # Enter 1.544 value converted and buttons enabled
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss,'1.544')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(1.5)
        self.openAdvancedNet()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "1.5")
        self.harness.VerifySafely(
            status,True," input '1.544' is converted to '1.5'")
        # test UP button
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss)
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.settingsInstance.CloseVMSettings(btnOK)
        self.VMXVerify(2.0)
        self.openAdvancedNet()
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss) == "2.0")
        self.harness.VerifySafely(
            status, True, " Up/Down buttons  become enabled")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        # verified all, close VMsettings and Workstation
        self.harness.AddTestComment("close vm settings")
        self.settingsInstance.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        self.vmInstance.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        self.vmInstance.CloseWorkstation()


class test22(generalCase):
    def startTest(self, testdata):
        self.harness.SetTestDescription(
            "Out-Bandwidth drop down selected values")
        self.harness.AddTestComment("Create a new VM")
        self.vmInstance.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        self.settingsInstance.OpenVMSettings()
        self.settingsInstance.SelectSettingsHardware(
        vmSettingsWindow, "lstNetworkAdapter")
        click(vmSettingsWindow, btnAdvancedNet)
        status = bool(waittillguiexist(frmNetworkAdapterAdvancedSettings))
        self.harness.VerifySafely(
            status,True,"Dialog 'Network Adapter Advanced Settings' Opens")
        click(frmNetworkAdapterAdvancedSettings,btnOpen)
        comboselect(
            frmNetworkAdapterAdvancedSettings,cboBandwidth1,"Cable (4 Mbps)")
        status = bool(gettextvalue
            (frmNetworkAdapterAdvancedSettings,txtKbps1) == "4000")
        self.harness.VerifySafely(
            status, True, "The value for out-Kbps is 4000")
        status = (self.vmInstance.GetVMXValue(
            self.vmInstance.testvmDir,testdata['vmname'],
            '%s.vmx'%testdata['vmname'],
            'ethernet0.txbw.limit')[1] == '"4000"')
        self.harness.VerifySafely(status, True, 'The in-Kbps value: 4000')
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("Close VM settings")
        self.settingsInstance.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        self.vmInstance.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        self.vmInstance.CloseWorkstation()


class test23(generalCase):

    def startTest(self, testdata):
        self.harness.SetTestDescription(
            "Out-Kbps spin box valid values")
        self.harness.AddTestComment("Create a new VM")
        self.vmInstance.CreateNewVM()
        self.harness.AddTestComment("Launch VM Settings Dialog")
        self.settingsInstance.OpenVMSettings()
        self.settingsInstance.SelectSettingsHardware(
        vmSettingsWindow, "lstNetworkAdapter")
        click(vmSettingsWindow,btnAdvancedNet)

        valueList = ['35', '4000', '28', '1544']
        expectedList = ['Custom', 'Cable (4 Mbps)',
                        'Modem (28.8 Kbps)',
                        'Leased Line T1 (1.544 Mbps)' ]

        for value, expected in zip(valueList, expectedList):
            settextvalue(frmNetworkAdapterAdvancedSettings,txtKbps1, value)
            status = bool(verifyselect(
                frmNetworkAdapterAdvancedSettings,cboBandwidth1, expected))
            self.harness.VerifySafely(
                status,True," %s is selected" % expected)

        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        self.settingsInstance.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        self.vmInstance.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        self.vmInstance.CloseWorkstation()


class test24(generalCase):

    def VMXVerify(self, checkedValue):
        packetLoss = self.vmInstance.GetVMXValue(
            self.vmInstance.testvmDir, self.testdatadict['vmname'],
             '%s.vmx' % self.testdatadict['vmname'],
            'ethernet0.txfi.droprate')[1]
        status = (int(packetLoss.strip('"')) ==
                  int(round(float(checkedValue.strip("'")),1) * 10))
        self.harness.VerifySafely(status, True,
            'The packet loss %% is %s' % checkedValue)

    def startTest(self, testdata):
        self.harness.SetTestDescription(
            "Out-PacketLoss valid values")
        self.harness.AddTestComment("Create a new VM")
        self.testdatadict = getTestDataList(testdata)
        self.vmInstance.CreateNewVM(vmName=self.testdatadict['vmname'])
        self.harness.AddTestComment("Launch VM Settings Dialog")
        self.settingsInstance.OpenVMSettings()
        self.settingsInstance.SelectSettingsHardware(
         vmSettingsWindow, "lstNetworkAdapter")
        self.harness.AddTestComment("click 'Advanced' button'")
        click(vmSettingsWindow,btnAdvancedNet)

        valueList = ['7.5', '28', '1.544']
        valuesInUI = ['7.5', '28.0', '1.5']
        UpValues = ['8.0','29.0','2.0']
        DownValues = ['7.0','28.0', '1.0']
        for value, UIValue, up, down in zip(
                valueList, valuesInUI, UpValues, DownValues):
            settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,value)
            self.closeNAAS()
            self.VMXVerify(value)
            self.openAdvancedNet()
            status = bool(gettextvalue(
                frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == UIValue)
            self.harness.VerifySafely(
                status,True,"input %s is accepted" % UIValue)

            # check UP button
            self.generalInstance.SendKeyboardInput(
                '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
            self.closeNAAS()
            self.VMXVerify(up)
            self.openAdvancedNet()
            status = bool(gettextvalue(
                frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == up)
            self.harness.VerifySafely(
                status,True," input %s is accepted and UP enabled" % up)

            #check DOWN button
            self.generalInstance.SendKeyboardInput(
                '<DOWN>',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
            self.closeNAAS()
            self.VMXVerify(down)
            self.openAdvancedNet()
            status = bool(gettextvalue(
                frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == down)
            self.harness.VerifySafely(
                status, True, " input %s accepted and DOWN enabled" % down)

        # Enter 4000, value not accepted and down button enabled, up disabled
        settextvalue(frmNetworkAdapterAdvancedSettings,txtPacketLoss1,'4000')
        self.harness.AddTestComment("click 'OK' button'")
        click(frmNetworkAdapterAdvancedSettings,btnOK)
        status = bool(waittillguiexist(dlgQuestion))
        self.harness.VerifySafely(status,True," input '4000'  not accepted")
        click(dlgQuestion,btnOK)
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "100.0")
        self.harness.VerifySafely(status, True, "value converted to 100.0")
        self.generalInstance.SendKeyboardInput(
            '<UP>',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "100.0")
        self.harness.VerifySafely(status, True, "Up button is disabled")
        self.generalInstance.SendKeyboardInput(
            '<DOWN>',frmNetworkAdapterAdvancedSettings,txtPacketLoss1)
        status = bool(gettextvalue(
            frmNetworkAdapterAdvancedSettings,txtPacketLoss1) == "99.0")
        self.harness.VerifySafely(status, True, "Down button is enabled")

        click(frmNetworkAdapterAdvancedSettings,btnOK)
        self.harness.AddTestComment("close vm settings")
        self.settingsInstance.CloseVMSettings(btnOK)
        self.harness.AddTestComment("Delete VM")
        self.vmInstance.DeleteVM()
        self.harness.AddTestComment("Close VMware Workstation")
        self.vmInstance.CloseWorkstation()
