Description Object
Description Object
Crypt Object DataTable Object Description Object DotNetFactory Object DTParameter Object DTSheet Object Environment Object Extern Object LocalParameter Object MercuryTimers Object (Collection) MercuryTimer Object Parameter Object PathFinder Object Properties Object (Collection) QCUtil Object RandomNumber Object Recovery Object Reporter Object RepositoriesCollection Object Repository Object Services Object Setting Object TextUtil Object TSLTest Object XMLUtil Object
Description Object Description object is used to create an empty description object in the script. We can add properties and values to the created object. Using an empty Description object Set obj=Description. create Here obj is an empty object and contains no properties. This refers any object in application. Ex:Set obj=Description. create Set objList=Browser(micclass:=Browser).Page(micclass:=Page).Childobjects( obj) Msgbox objList.count Gives Total objects count in the page Using Description object with properties Set obj=Description. create obj(micclass).value=Link
Now objis a link object and it refers all link objects in application. Ex:1) Set obj=Description. create obj(micclass).value=Link Set objList=Browser(micclass:=Browser).Page(micclass:=Page).Childobjects( obj) Msgbox objList.count Gives Total Link objects count in the page 2) Set obj=Description. create obj(micclass).value=Link obj(name).value=Login Set objList=Browser(micclass:=Browser).Page(micclass:=Page).Childobjects( obj) Msgbox objList.count Gives only the link which is having Login name Description object is useful when object properties are changing dynamically or if objects are adding in application dynamically and also to handle the duplicate objects (repeated objects). '@@@@@@@@@@@ @@@@@@@@@ @@@@@@@@@ @@@@@@@@@ @@
Environment object is to work with environment variables. Environment variable is a global variable which can be accessible from entire test.
User defined environment variable and value can be created and changed at any time.
This statement will create a new variable (DemoVar) and assigns a value (demo) in runtime. With this logic we can easily exchange the values between actions.
For example I f you want to pass a value to other action Follow these steps.
Msgbox Environment( "DemoVar" ) Hi, Here iam giving some samples about WSH scripting. Regards, Sudhakar
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@
WSH Samples
'How to get the current UserName of logged in Set WshNetwork = CreateObject("WScript.Network") userName = WshNetwork.username Set WshShell = CreateObject("WScript.Shell") WshShell.Popup userName ", 50, " userName "
How to send keyboard inputs to application set WshShell = CreateObject("WScript.Shell") WshShell.SendKeys "gjhfghjfghjf"
How to get the value of the system environment variable Set WshShell = CreateObject("WScript.Shell") Set WshSysEnv = WshShell.Environment("SYSTEM") WScript.Echo WshSysEnv("NUMBER_OF_PROCESSORS")
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@