Monday, March 17, 2014

Working on Windows Shell, Registy keys and TextUtil using QTP

Change the Registry Key Values:
‘f_WriteRegEdit(“HKCUControl PanelInternationalsShortDate”,datatable(“DateFormat”),”REG_SZ”)
Function f_WriteRegEdit(strKeyPath,strKeyVal,strValType)
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.RegWrite strKeyPath, strKeyVal, strValType
End Function
msgbox f_ReadRegEdit(“HKCUControl PanelInternationalsShortDate”)
Function f_ReadRegEdit(strKeyPath)
Set WshShell = CreateObject(“WScript.Shell”)
f_ReadRegEdit=WshShell.RegRead (strKeyPath)
End Function


How to make QC Status incomplete, during script execution:
Reporter.ReportEvent micPass,”test”,”test”
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.SendKeys “{F4}”
Reporter.ReportEvent micPass,”test”,”test”
——————————————————————————————————————————————
Window or Page  is not recognizing ???? you may use shell scripting and textutil.GetText to avoid such situations…
Let me know if you have any issues using the code…
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.SendKeys “{TAB 1}”
WshShell.SendKeys “some data”
msgbox textutil.GetText(“1704986″)

No comments:

Post a Comment