SystemUtil.Run ( FileName, Parameters, Path, Operation )
SystemUtil.Run(“iexplorer.exe”,http://www.google.com)
SystemUtil.Run(“test.txt”, “”,”C:\”,”1”)
InvokeApplication “C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.google.com”
WScript.shell
” object.Set testshell= CreateObject (“Wscript.shell”)
testshell.run "%windir%\notepad"
Platform = Environment(“OS”)
. Then based on the Platform you need to call the actions which you recorded on that particular platform.Browser(“Core Values”).GetROProperty(“version”)
you can extract the Browser and its correspondin version. Ex : Internet Explorer 6 or Netscape 5. Based on this value you call the actions which are relevant to that browser.Browser(“Browser”).Page(“freetimelearn”)
Here freetimelearn is the logical name of the object. property:=values,
Set MyDescription = Description.Create();
MyDescription("property").Value = "property-value";​
Browser(“name:=”xxx””).page(“name:=”xxxx””)
…..micClass
”.Browser(“micClass:=browser”).page(“micClass:=page”)
….CreateObject(servername.typename [, location])
Set IE = CreateObject(“InternetExplorer.Application”)
Method | Description | Syntax |
---|---|---|
AddSheet | Adds the supplied sheet to the data table at runtime. | DataTable.AddSheet (SheetName) |
DeleteSheet | The given sheet is removed from the run-time data table. | DataTable.DeleteSheet( SheetID) |
Export | The Datatable is exported to a new file in the provided location. | DataTable.Export(FileName) |
ExportSheet | Run-time export of a specific sheet of the Datatable. | DataTable.ExportSheet(FileName, SheetName) |
GetSheet | The given sheet from the run-time data table is returned. | DataTable.GetSheet(SheetID) |
GetCurrentRow | Returns the active row of the global sheet's run-time data table.2 | DataTable.GetCurrentRow |
GetParameterCount | The number of columns in the run-time data is returned. | DataTable.GetParameterCount |
GetRowCount | The number of rows in the Global Sheet's run-time data table is returned. | DataTable.GetRowCount |
GetSheetCount | The total number of sheets in the run-time data table is returned. | DataTable.GetSheetCount |
SetCurrentRow | Sets the current row's focus to the specified row number. | DataTable.SetCurrentRow(RowNumber) |
SetNextRow | Sets the focus of the run-time data table's next row. | DataTable.SetNextRow |
SetPreviousRow | Sets the previous row's focus in the run-time data. Table | DataTable.SetPrevRow |
“ORM -> File -> Enable Editing”
Mydecimal = 8.2755555
Roundedvalue = Round(Mydecimal , 5)
Print roundedvalue ‘it will print 8.275
Browser("creationtime:=1").Close
Design"-> "Synchronization Point
"..txt
) files. With this, the size of the result files or group of files will occupy more system space.object spy…
” In the Object, spy Dialog click on the button showing the hand symbol. The pointer now changes into a hand symbol and we have to point out the object to spy the state of the object. If at all the object is not visible or the window is minimized then hold the Ctrl button and activate the required window and release the Ctrl button.Unified Functional Testing (UFT) | Selenium |
---|---|
It is a Micro Focus commercial tool, thus it requires a licence and is costly. | It's an open-source testing tool, therefore there's no need for a licence and it's completely free. |
It's used for client-server application testing. It can test both web and desktop applications. | Only web applications can be automated with Selenium. |
Only the QTP IDE can be used to create QTP tests. | Selenium can be used with a variety of IDEs, including Visual Studio, Eclipse, and Netbeans. |
Only VB scripts are supported by HP UFT. | Selenium supports a wide range of programming languages, including Java,.NET, Ruby, Perl, PHP, and many others. |
A built-in object repository is included with HP UFT. In HP ALM, creating and maintaining object repositories is a breeze. | Although Selenium lacks a built-in object repository, objects can be maintained using the UI element user extension. |
HP UFT is compatible with test management software such as HP Quality Center. | Selenium is not compatible with any such test management software. |
UFT Testing supports all forms of dialogue boxes. | It partially supports dialogue boxes. |
It supports a variety of environments, including SAP, Oracle, and.NET, but users must acquire an add-on licence for each of them. | It allows you to add plug-ins to provide functionalities that Selenium doesn't give by default. |
Because of the licencing fees, automation testing is costly. | Selenium web automation testing is less expensive. |
HP QTP provides excellent technical support. | Because it is an open-source project, it receives no formal support. |
Only VBScript is supported by HP QTP. Hence Test Automation using an Object-Oriented Approach gets difficult. | Selenium supports Object-Oriented Programming Languages such as Java. |
HP QTP is more user-friendly, and scripts may be written faster. | It's a simple tool with limited capabilities. The development and maintenance of a script take more time. |
Backward compatibility has a lot of power. The most recent version of HP ALM supports code that was written five years ago. | In Selenium, the API evolves with each new Selenium release. As a result, test scripts must be modified. |
Create a shell object
Set MyShell= CreateObject (“WScript.Shell”)
Read the value of key from the registry
RegValue =MyShell.RegRead (varpathofkey)
‘in above function we have to pass the path of key in registery’.
EX : HKCU\software\ie\settings
msgbox RegValue
Set myShell = CreateObject (“WScript.Shell”)
WScript.Echo myShell.ExpandEnvironmentStrings( "%PATHEXT%" )
myShell=Nothing,​
.BAT;.CMD;.VBS;. VBE;. JS;. JSE
Set myShell = CreateObject( "WScript.Shell" )
WScript.Echo myShell.ExpandEnvironmentStrings( "TEMP=%TEMP%" )
myShell=Nothing
TEMP:C:\DOCUME~1\You\LOCALS~1\Temp
filepath = “C:\Bugs\Reports.xlsx”
Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible= True
Set Wb= objExcel.Workbooks.Open (filepath)
Wb.worksheets(1).Cells(1,1).Value = “FreeTimeLearn” read value from Excel file
.tsr
file. Give the path and save. This will create .tsr
file in UFTDo…..Loop
: Do Loop will run a block of statements repeatedlyFor…..Next
: For Next Loop will execute a series of statements until a specific counter valueFor……Each
: In order to execute a series of statements for each statements for each object in collection “For Each Loop” is usedWhile….Wend Loop
: While Wend Loop is used to execute a series of statements as long as given condition is trueDataTable.ImportSheet "..\..\TestData\Input.xls",1,dtGlobalSheet
DataTable.ExportSheet "..\..\Results\Output.xls","Global"
Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]
Crypt.Encrypt(“FreeTimeLearn”)
pwd= “myvalue”
pwd = Crypt.Encrypt (pwd)
Browser(“myb”).WinEdit (“pwd”). SetSecure pwd
Dim A (10) – single dimension
Dim MyTable (5,10) – multi-dimension
Dim MyArray()ReDim MyArray(25)
A= Array (10, 20,30)
B= A(2) ‘ B is now 30
GetROProperty
” is an in built method used to retrieve runtime value of an object property.