Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Friday, 18 December 2015

Exist Stament In Vb-Script

Exits a procedure or block and transfers control immediately to the statement following the procedure call or the block definition.

Statements

Exit Do: Immediately exits the Do loop in which it appears. Execution continues with the statement following the Loop statement. Exit Do can be used only inside a Do loop. When used within nested Do loops, Exit Do exits the innermost loop and transfers control to the next higher level of nesting.

Exit For: Immediately exits the For loop in which it appears. Execution continues with the statement following the Next statement. Exit For can be used only inside a For...Next or For Each...Next loop. When used within nested For loops, Exit For exits the innermost loop and transfers control to the next higher level of nesting.

Exit Function: Immediately exits the Function procedure in which it appears. Execution continues with the statement following the statement that called the Function procedure. Exit Function can be used only inside a Function procedure.To specify a return value, you can assign the value to the function name on a line before the Exit Function statement. To assign the return value and exit the function in one statement, you can instead use the Return Statement (Visual Basic).

Exit Property: Immediately exits the Property procedure in which it appears. Execution continues with the statement that called the Property procedure, that is, with the statement requesting or setting the property's value. Exit Property can be used only inside a property's Get or Set procedure.
To specify a return value in a Get procedure, you can assign the value to the function name on a line before the Exit Property statement. To assign the return value and exit the Get procedure in one statement, you can instead use the Return statement. In a Set procedure, the Exit Property statement is equivalent to the Return statement.

Exit Select: Immediately exits the Select Case block in which it appears. Execution continues with the statement following the End Select statement. Exit Select can be used only inside a Select Case statement.

Exit Sub: Immediately exits the Sub procedure in which it appears. Execution continues with the statement following the statement that called the Subprocedure. Exit Sub can be used only inside a Sub procedure.
In a Sub procedure, the Exit Sub statement is equivalent to the Return statement.

Exit Try: Immediately exits the Try or Catch block in which it appears. Execution continues with the Finally block if there is one, or with the statement following the End Try statement otherwise. Exit Try can be used only inside a Try or Catch block, and not inside a Finally block.

Exit While: Immediately exits the While loop in which it appears. Execution continues with the statement following the End While statement. Exit Whilecan be used only inside a While loop. When used within nested While loops, Exit While transfers control to the loop that is one nested level above the loop where Exit While occurs.

Note: Do not confuse Exit statements with End statements. Exit does not define the end of a statement.

Friday, 4 December 2015

Methods for Browser Object

Following are methods for Browser object:

OpenNewTab:-Opens a new tab in the existing opened browser window. 
Ex:Browser("CreationTime:=0").OpenNewTab()


Activate Browser:  using this method we can activate browser.
ExBrowser("title:=Google.*").Activate

Minimize Browser: using this we can minimize browser.
EX: Window("name:=Seessionwindow").Minimize

Maximize Browser: using this method we can maximize browser.
Ex: Window("name:=sessionwindow").Maximize

Navigate:-Redirects to given URL.

EX: Browser("CreationTime:=1").Navigate "www.Google.com"

FullScreen:-Open the browser in Full-screen mode(F11).

Ex: Browser("CreationTime:=0").FullScreen

Refresh:-Refresh the opened page(Like F5).

Ex:Browser("CreationTime:=0").Refresh

DeleteCookies:-For deleting the cookies from the browser.

Ex: Browser("CreationTime:=0").DeleteCookies

CloseAllTabs:-Close all the opened tab and also the browser instance.

Ex: Browser("CreationTime:=0").CloseAllTabs()

Sync:-Wait for the browser for navigating to the opened URL Application.

Ex:Browser("CreationTime:=0").Sync

NOTE: Browser does not support the ActivateMinimizeMaximize methods

Example:


'Open a new Browser using Util Object
SystemUtil.Run "iexplore.exe", "www.uft.com"

'Browser Sync
Browser("CreationTime:=0").Sync

'Delete cookies from the Browser
Browser("CreationTime:=0").DeleteCookies

'Refreshes the Opened Page
Browser("CreationTime:=0").Refresh

'Opening  a new tab within the same browser
Browser("CreationTime:=0").OpenNewTab()

'Opening Browser in FullScreen mode
Browser("CreationTime:=0").FullScreen

'Sync for new tab
Browser("CreationTime:=1").Sync

'Navigate to perticular URL in the new tab
Browser("CreationTime:=1").Navigate "www.Google.com"

'Find total number of tabs in the browser window
iTabs = Browser("CreationTime:=0").GetROProperty("number of tabs")
msgbox iTabs 'Displays the value 2

'Close all the tabs in the browser window
Browser("CreationTime:=0").CloseAllTabs()