Search This Blog

Wednesday, August 25, 2010

Excel Report - Excel Report Generator WithOut Using Quality Center

NOW u CAN generate reports from Excel Sheet without logging in to QC.
JUST give a click on Excel ........

It will WORK for ANY Project ANY Organization

PLZ wait for further details....or CONTACT ch.girish.ch@gmail.com

HP QTP 10.0 and QC 10.0 Latest Certification Questions

Hi, If anybody wants to write for QTP 10.0 and QC 10.0 Certification Question DUMPS....PLZ send a mail to my mail ID: ch.girish.ch@gmail.com

If you are thinking of getting certifications for QTP 9.2 and QC 9.2 then forget it, they are expired.......

Monday, August 23, 2010

How to Copy SQL query from a QC Generated Report or Graph

Subject: Copy SQL query from a QC Generated Report or Graph?

Can you get access to the underlying SQL query on a QC generated Report or Graph? We have several graphs that are only used for the data grid. We want to be able to run a Excel Report to generate this graph. Is the SQL stored in the database somewhere where it can be accessed?

Solution:

The Profiler tool that comes with SQL Server is useful for determining what call was made on the database by an event on a client tool. For example, if you require a specific SQL statement to get data from Quality Center, you can set up the Profiler and run a report from the Quality Center client. The Profiler will provide you with the SQL statement which was sent to the database for that report. You can then take this statement and customise it as required.

7.4.1.1 Loading the Profiler

1. Remote access into the database server that you require (e.g. PARV01110093)
2. Select Start > All Programs > Microsoft SQL Server > Profiler. The Profiler will load.
3. Select File > New > Trace¦ Provide login details for the correct database instance.



Trace Configuration

General Tab

¢ Give the trace a name.
¢ Template Name SQLProfilerStandard or SQLProfilerTSQL

Events Tab
Add the following event classes:
Stored Procedures
RPC: Starting
SP: StmtCompleted
SP: StmtStarting
TSQL
SQL: StmtCompleted
SQL: StmtStarting

Data Columns Tab
¢ Select the following data items:
EventClass
NTUserName
DatabaseID
TextData
SPID
StartTime

Filters Tab
Filter the trace to report only on a specific database
DatabaseName
Like


Running the Trace

As an SQL trace can contain an enormous amount of data, the more specific you can configure it the better. It is also important to start the trace immediately before the client event is executed. Make a note of when the client event is triggered to help you locate it in the trace data.

1. Load the Profiler
2. Configure the trace
3. Load the client application
4. Run the event that you wish to trace
5. Click the Run button on the Profiler
6. The trace will start running. When the tool client process has completed, click the red Stop button on the Profiler toolbar.

Please consult your DBA before running the profiler.



Thursday, August 19, 2010

HP QTP 10.0 and QC 10.0 Certification Details



Basically HP has come up with two types of Certifications, HP AIS(Foundation) & HP ASE(Advanced)
1. HP AIS Stands for Hewlett Packard Accredited Integration Specialist
* Below Exams need to be cleared for accomplishing HP AIS
--> HP0 M16 (QTP 9.2) -These got Expired
--> HP0 M15 (QC 9.0) -These got Expired
OR

--> HP0-M39 (QTP 10.0)
--> HP0-M31(QC 10.0)

HP0-M31 (old HP0-M15) and HP0-M39 (old HP0-M16)





2. HP ASE Stands for Hewlett Packard Accredited Systems Engineer
* HP AIS clearance is mandatory for appearing HP ASE

Before appearing HP AIS Certification exams, follow the below steps

Points to be known for appearing HP AIS Certification(QTP & QC).


Step 1: Navigate to the HP Partner Portal using the below link
http://h20375.www2.hp.com/portal/site/publicpartnerportal-ap/in/en/

Step 2: Click on Register link & complete the registration process.

Step 3: You will receive an email regarding your User Id & a Link Create New Password from Premium.support@hp.com & create a new pwd.

Step 4: Login into HP Partner Portal by your User Id & password , click on Train & Certify --> Request Access, it will take around 3 business days for creation of HP Learner Id.

Step 5: HP Partner Portal -->Train & Certify --> Access the Learning Center ->My Profile --> Edit Profile Snapshot change the required ISD time frames --> Save

Step 6: Login to HP Partner Portal --> Train & Certify --> Access the Learning Center --> Note down your HP Learner Id --> Contact Prometric Testing Center in any NIIT institute in your city for appearing the HP AIS exam.


After clearing the HP AIS Certification exams, below steps are required for achieving the HP AIS Certification - Soft Copy

Step 7: Once you have cleared HP0 M15 & HP0 M16 Exams, navigate to below path for knowing your Exam Successful Completion Status.
Login to HP Partner Portal -->Train & Certify --> Access the Learning Center -->My Learning --> My Transcripts

Step 8: Login to HP Partner Portal -->Train & Certify --> Access the Learning Center -->My Learning -->My Certification
Click on Add Certification & search for required certification (AIS HP Quality Center V9) & select the checkbox & then your certification will be added to the Certifications table & status field will be given as Assigned.

Step 9: Login to HP Partner Portal -->Train & Certify --> Access the Learning Center -->My Learning -->My Certification--> In Certification table,
check the Status field, if it is updated as Acquired in 1 week your certification will be uploaded into your HP Learner id Account.

Step 10: After 1 week , Login into HP Partner Portal --> Certification Program click on My E-Certificates, In E-Certificates HP Certified Professional Program page AIS HP Quality Center V9 Professional Letter A4 can be seen.

Step 11: click Letter or A4 & Save the soft copy/attachment into your system

How to view Results if error occurs while trying to open Results



Two files which got affected in displaying Results:
1) Results.xml and 2) GeneralInfo.ini.

Results.xml – contains all the test result data in the structured format. Due to abnormal closing of QTP, some tags in this xml file does not close properly, due to which test result viewer is not able to read it properly.

GeneralInfo.ini – once QTP execution is successfully done, it creates this ini file which initiates the result viewer and contains the required information to populate the result.

So whenever you get such an error, go to your result path (report folder). You will notice that there is no general info file has been created. In case it is there trying opening in notepad. You will find that no data is there. That means you will have to create this file in order to view the result.

Create a txt file in your report folder name it as ‘GeneralInfo.ini’ and Open it in notepad.

Write the text mentioned below –

[General] ‘ini file tag. Keep this intact
Product= ‘name of the product which will be QuickTest Professional
Version = ‘Version of your QTP
Total = ‘the number of total lines in the xml file for result (explained below)
Title= ‘Script Title
OSVersion = ‘version of operating system
TestLocation= ‘Test Path

Parameter ‘Total’ can be retrieved from the incomplete results.xml file.

Open the file in any file editor. Go to the end of the file. Search the first tag which contains from bottom.You will see a value assigned there to rID as in the below piece of xml.




Wednesday, August 18, 2010

Automated Regression Testing Challenges in Agile Environment

Abstract
Recently, when I wanted to start my new Automated Testing Project with four resources, I thought of applying any one of the Agile methodologies. But I was not able to continue because, a series of questions were raised inside my mind. The questions are like “Is it possible to use Agile methodologies in Automated Testing?”, “Can I use traditional tools”, “Should I have to go for open-source tools”, “What are the challenges I have to face if I am implementing automation in Agile Environment”. In this article let us analyze some of challenges we face while implementing Automation with Agile methodologies. Automated testing in the Agile environment stands a risk of becoming chaotic, unstructured and uncontrolled.

Agile Projects present their own challenges to the Automation team; Unclear project scope, Multiple iterations, Minimal documentation, early and frequent Automation needs and active stakeholder involvement all demand lot of challenges from the Automation Team. Some of these challenges are:

Challenge 1: Requirement Phase
Test Automation developer captures requirements in the form of “user stories”, which are brief descriptions of customer-relevant functionality.

Each requirement has to be prioritized as follows:

High: These are mission critical requirements that absolutely have to be done in the first release
Medium: These are requirements that are important but can be worked around until implemented.
Low: These are requirements that are nice-to-have but not critical to the operation of the software.

Once priories are established, the release “iterations” are planned. Normally, each Agile release iteration takes between 1 to 3 months to deliver. Customers/software folks take liberty to make too many changes to the requirements. Sometimes, these changes are so volatile that the iterations are bumped off. These changes are greater challenges in implementing Agile Automation testing process.

Challenge 2: Selecting the Right Tools

Traditional, test-last tools with record-and-playback-features force teams to wait until after the software is done. More over, traditional test automation tools don’t work for an Agile context because they solve traditional problems, and those are different from the challenges facing Agile Automation teams. Automation in the early stages of an agile project is usually very tough, but as the system grows and evolves, some aspects settle and it becomes appropriate to deploy automation. So the choice of testing tools becomes critical for reaping the efficiency and quality benefits of agile.

Challenge 3: Script Development Phase

The Automation testers, developers, business analysts and project stakeholders all contribute to kick-off meetings where “user-stories” are selected to next sprint. Once the “user-stories” are selected for the sprint, they are used as the basis for a set of tests.

As functionality grows with each iteration, regression testing must be performed to ensure that existing functionality has not been impacted by the introduction of new functionality in each iteration cycle. The scale of the regression testing grows with each sprint and ensures that this remains a manageable task the test team use the test automation for the regression suite.

Challenge 4: Resource Management

The Agile approach requires a mixture of testing skills, that is, test resource will be required to define unclear scenarios and test cases, conduct manual testing alongside developers, write automated regression tests and execute the automated regression packages. As the project progresses, specialist skills will also be required to cover further test areas that might include integration and performance testing. There should be an appropriate mix of domain specialist who plan and gather requirements. The challenging part in the Resource management is to find out test resources with multiple skills and
allocate them.

Challenge 5: Communication

Good communication must exist among Automation testing team, developers, business analysts and stake holders. There must be highly collaborative interaction between client and the delivery teams. More client involvement implies more suggestions or changes from the client. It implies more bandwidth for communication. The key challenge is that the process should be able to capture and effectively implement all the changes and data integrity needs to be retained. In traditional testing, developers and testers are like oil and water, but in agile environment, the challenging task is that they both must work together to achieve the target.

Challenge 6: Daily Scrum Meeting

Daily Scrum Meeting is one of the key activities in Agile Process. Teams do meet for 15 minutes stand up sessions. What is the effectiveness of these meetings? How far these meetings help Automation practice Developers?

Challenge 7: Release Phase

The aim of Agile project is to deliver a basic working product as quickly as possible and then to go through a process of continual improvement. This means that there is no single release phase for a product. The challenging part lies in integration testing and acceptance testing of the product.

If we can meet these challenges in a well optimized manner, then Automated Regression Testing in Agile environment is an excellent opportunity for QA to take leadership of the agile processes. It is better placed to bridge the gap between users and developers, understand both what is required, how it can be achieved and how it can be assured prior to deployment. Automation practice should have a vested interest in both the how and the result, as well as continuing to assure that the whole evolving system meets business objectives and is fit for purpose.

How to Manage Automation Expectations:

How to Manage Automation Expectations:
In order to implement a successful automation effort, testers need to educate management on a number of different issues. Educating management on these issues could mean the difference between a successful automation effort and a failed automation attempt.


One such important issue addresses integrating test automation into the entire development process. Testers need to educate senior management as well as script writers on how a specific tool will fit into their software development environment and software development life cycle. It is equally important to remind everyone that manual testing does not end when automation is implemented.


Another issue concerns the purchasing of tools and their impact on test planning. Test planning, planning what to test and how to test, becomes much more complex and more important when a tool is purchased. For example, test automation is rarely justified for all testing. The tester needs to determine what tasks make sense to automate and what does not make sense to automate.


Moreover, the organization needs to understand that automation does not eliminate manual efforts on the part of testers. Testers need to maintain automation scripts and verify the execution of automated scripts. This is manual work that needs to be factored into the test team's testing activities.


In addition, in order to automate successfully, testers need training and time to master the test tools. Many managers view the test tools as simple capture / playback programs which a tester can learn and implement in his spare time. This is a misconception. Successful test automation frequently requires the use of complex tools — tools which are much more complex than the just capture / replay tools. In order to use these tools effectively, testers need considerable training. Management needs to be committed to training testers on these tools and to establishing the infrastructure in which the tool operates.


Also successful test automation requires the involvement of the software development team as well as testers. In the past, developers and testers had minimal contact. Frequently, the philosophy was to "throw code over the wall and see if it works". This type of interaction does not work when automating the testing process. Developers and testers need to work much more closely together. Developers have to provide support personnel and technical information on their development methods. They can be asked to use the automation tools during their unit and integration testing. More troubling to the developer will be that test automation may raise concerns about the testability of their code. This especially will be the case if standards are not followed, or if developers use odd, homegrown or even very new libraries / objects.


The organization’s project management team must have a clear understanding about the types of roles and responsibilities required for a successful automation effort. The creation of the test environment starts when an organization purchases hardware and installs a tool. Then the test team and development team need to work together to build and maintain a test automation environment that may include dedicated servers, workstations, databases and the like. Management needs to include development of the test environment in the overall project plan. They should also budget for the resources needed to successfully automate testing.


Successful tool automation depends not only on the test tools but also on a standard testing process and the right test team roles, duties and skills. Tools, process and test teams are the three essential legs of the test automation stool.


Moreover, the automation test team needs to have a blend of testing, programming, and tool knowledge. If an organization wants to reap the automation benefits promised by tool vendors, it needs to use the tool as a complement to manual testing. It also means adopting a strong test methodology and training the test team on the ins and outs of the selected tool in an organization's unique development environment.

How to Generate Excel Reports in QC 10.0

To Create Excel reports -We need to have access for DashBoard module in QC 10.0
For QC 9.2 the reports option is under Tools - Home Page
and For QC 9.0 there is no option to generate Excel Reports

Navigation - QC 10.0 -
1) Go to DashBoard module
2) Select Excel Report in top left corner
3) Enter Report Name
4) Write Query under Query Tab
5) Add macro under Post Processing Script
6) Set the Status to "Ready"
7) For test purpose we can use Query Generator
8) For viewing of Tables we can use Query Generator
9) Click Generate Query
10)There you go report

Tuesday, August 17, 2010

Advantages and Disadvantages of Dictionary Objects

Dictionary Object

Dictionary Object stores data key, item pairs. A Dictionary object stores the items in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually an integer or a string, but can be anything except an array.



Adavntages of using it in QTP:

1. can be used as Global variable declaration. so that any test can access the values from it in the run time.

2. You can store and retrive any number of run time values in to dictonary.

3. It is one of the Parameterization techique we can use in QTP



Disadvantages:

we can not specify the values in the desingn time like Datatable , Action parameters, environment variable.

So it is useful only in Run time , not design time

What is Dictionary Object - Overview

Dictionary object allows storing key value pairs. A dictionary object can be used for easy lookup of values. Dictionary is a not a QTP specific functionality and is available in normal VBScript as well.

Creating the Dictionary
A dictionary object can be created using CreateObject for COM class “Scripting.Dictionary”. The code below shows how to create the dictionary object in QTP


'Create the Dictionary Object
Set oDict = CreateObject("Scripting.Dictionary")


Below table shows list of methods that dictionary objects supports.
Method Description
Add (key, item)- Adds a key and item pair to a Dictionary object.
Exists(key)- Returns true if a specified key exists in the Dictionary object, false if it does not
Items() - Returns an array containing all the items in a Dictionary object
Keys() - Returns an array containing all existing keys in a Dictionary object.
Remove(key) - Removes a key, item pair from a Dictionary object
RemoveAll() - The RemoveAll method removes all key, item pairs from a Dictionary object.

Count - Returns the number of items in a Dictionary object. Read-only.
Item Sets or returns an item for a specified key in a Dictionary object. Read/write
Key(Key) Sets a key in a Dictionary object.

Adding Items to Dictionary:
There are two ways to Add items to dictionary. One is to use the Add method and another is to use the Item property. Both the methods are shown in code below
'Method 1 for Adding items to dictionary
'Add items to dictionary
oDict.Add "CA", "California"
oDict.Add "LA", "Los Angeles"

'The below line will throw an error as LA key already exist
oDict.Add "LA", "Los Angeles 2"

'Method 2 for adding items to dictionary
oDict.Item("CA") = "California"

'Item is the default property so ".Item" is not required
oDict("LA") = "Los Angeles"

'No Error this time as we are actually using the
'Item property and not the Add method
oDict("LA") = "Los Angeles 2"100 Miles From Memphis

Monday, August 16, 2010

Checklist for web services

Design Considerations

Design chunky interfaces to reduce round trips.

Prefer message-based programming over remote procedure call (RPC) style.

Use literal message encoding for parameter formatting.

Prefer primitive types for Web service parameters.

Avoid maintaining server state between calls.

Consider input validation for costly Web methods.

Consider your approach to caching.

Consider approaches for bulk data transfer and attachments.

Avoid calling local Web Services.
Connections
**********************************************************

Configure the maxconnection attribute.

Prioritize and allocate connections across discrete Web services.

Use a single identity for outbound calls.

Consider UnsafeAuthenticatedConnectionSharing with Windows Integrated Authentication.

Use PreAuthenticate with Basic authentication.
Threading
********************************************************************

Tune the thread pool using the formula for reducing contention.

Consider minIoThreads and minWorkerThreads for intermittent burst load.
One Way (Fire and Forget) Communication
**********************************************************************

Consider using the OneWay attribute if you do not require a response.
Asynchronous Web Methods
*********************************************************************

Use asynchronous Web methods for I/O operations.

Do not use asynchronous Web methods when you depend on worker threads.
Asynchronous Invocation
*********************************************************************

Consider calling Web services asynchronously when you have additional parallel work.

Use asynchronous invocation to call multiple unrelated Web services.

Call Web services asynchronously for UI responsiveness.
Timeouts
*********************************************************************

Set your proxy timeout appropriately.

Set your ASP.NET timeout greater than your Web service timeout.

Abort connections for ASP.NET pages that timeout before a Web services call completes.

Consider the responseDeadlockInterval attribute.
WebMethods
*********************************************************************

Prefer primitive parameter types.

Consider buffering.

Consider caching responses.

Enable session state only for Web methods that need it.
Serialization
*********************************************************************

Reduce serialization with XmlIgnore.

Reduce round trips.

Consider XML compression.
Caching
*********************************************************************

Consider output caching for less volatile data.

Consider providing cache-related information to clients.

Consider perimeter caching.
State Management
*********************************************************************

Use session state only where it is needed.

Avoid server affinity.
Attachments
*********************************************************************

Prefer Base64 encoding. Direct Internet Message Encapsulation (DIME) is a supported part of Web Services Enhancements (WSE), but Microsoft® is not investing in this approach long-term. DIME is limited because the attachments are outside the SOAP envelope.
COM Interop
*********************************************************************

Avoid single-threaded apartment (STA) COM objects.

Sunday, August 8, 2010

VB Script - 3

Arrays

An array is a contiguous area in the memory referred to by a common name. It is a series of variables having the same data type. Arrays are used to store related data values. VBScript allows you to store a group of common values together in the same location. These values can be accessed with their reference numbers.

An array is made up of two parts, the array name and the array subscript. The subscript indicates the highest index value for the elements within the array. Each element of an array has a unique identifying index number by which it can be referenced. VBScript creates zero based arrays where the first element of the array has an index value of zero.

Declaring Arrays

An array must be declared before it can be used. Depending upon the accessibility, arrays are of two types:
• Local Arrays
A local array is available only within the function or procedure, where it is declared.

• Global Arrays
A global array is an array that can be used by all functions and procedures. It is declared at the beginning of the VBScript Code.

The Dim statement is used to declare arrays. The syntax for declaring an array is as follows:
Dim ArrayName(subscriptvalue)

Where, ArrayName is the unique name for the array and SubscriptValue is a numeric value that indicates the number of elements in the array dimension within the array.

Example:
Dim No_Passengers(3)
The No_Passengers can store 4 values.

Assigning values to the array
No_Passengers(0) = 1
No_Passengers(1) = 2
No_Passengers(2) = 3
No_Passengers(3) = 4

Static and Dynamic Arrays:

VBScript provides flexibility for declaring arrays as static or dynamic.
A static array has a specific number of elements. The size of a static array cannot be altered at run time.

A dynamic array can be resized at any time. Dynamic arrays are useful when size of the array cannot be determined. The array size can be changed at run time.
Next we will deal with user defined procedures, functions and subroutines.


This post is third in the VB Script and QTP series.

Here we shall talk about user defined procedures.

Procedures are set of executable statements.

In VBScript, there are two types of procedures:

Sub Procedures
Function Procedures




Sub Procedures

A sub procedure is a series of VBScript statements, enclosed by Sub and End Sub statements which perform actions but do not return a value. A sub procedure can take arguments. If a sub procedure doesn’t receive any arguments, its Sub statement must include an empty parenthesis().

The following Sub procedure uses two intrinsic, or built-in, VBScript functions, MsgBox and InputBox , to prompt a user for information. It then displays the results of a calculation based on that information. The calculation is performed in a Function procedure created using VBScript. The Function procedure is shown after the following discussion.

Sub ConvertTemp()
temp = InputBox("Please enter the temperature in degrees F.", 1)
MsgBox "The temperature is " & Celsius(temp) & " degrees C."
End Sub

Function Procedures

A function procedure is a series of VBScript statements enclosed by the Function and End Function statements. A function procedure is similar to a sub procedure but it can return value to the calling function. A function procedure can take arguments (constants, variables or expressions that are passed to it by a calling procedure). If a function procedure has no arguments, it Function statement must include an empty set of parenthesis. A function returns a value by assigning a value to its name in one or more statements of the procedure. Since VBScript has only one base data type, a function always returns a variant.

In the following example, the Celsius function calculates degrees Celsius from degrees Fahrenheit. When the function is called from the ConvertTemp Sub procedure, a variable containing the argument value is passed to the function. The result of the calculation is returned to the calling procedure and displayed in a message box.

Sub ConvertTemp()
temp = InputBox("Please enter the temperature in degrees F.", 1)
MsgBox "The temperature is " & Celsius(temp) & " degrees C."
End Sub

Function Celsius(fDegrees)
Celsius = (fDegrees - 32) * 5 / 9
End Function

Tips:
To get data out of a procedure, you must use a Function. Remember, a Function procedure can return a value; a Sub procedure can't.
AFunction in your code must always be used on the right side of a variable assignment or in an expression.
To call a Sub procedure from another procedure, type the name of the procedure along with values for any required arguments, each separated by a comma. The Call statement is not required, but if you do use it, you must enclose any arguments in parentheses.
The following example shows two calls to the MyProc procedure. One uses the Call statement in the code; the other doesn't. Both do exactly the same thing.

Call MyProc(firstarg, secondarg)

MyProc firstarg, secondarg

Notice that the parentheses are omitted in the call when the Call statement isn't used.

VB Script - 2

This is in continuation from VB Script and QTP - Part1 on our series of posts on VB Script. Here, we will dwell upon conditional constructs, iterative constructs and arrays.

Conditional Constructs

Conditional Constructs execute statements or repeat certain set of statements based on conditions.
The following conditional constructs are available in VBScript
• If – Then –Else
• Select Case

If – Then – Else Construct

The If – Then- Else Construct is used to evaluate whether a condition is true or false and depending on the result, to specify one or more statements to execute. Usually the condition is an expression that uses a comparison operator to compare one value or variable with another. The If- Then – Else statements can be nested to as many levels as needed.
For example:

Sub ReportValue(value)


If value = 0 Then
MsgBox value
ElseIf value = 1 Then
MsgBox value
ElseIf value = 2 then
Msgbox value
Else
Msgbox "Value out of range!"
End If

You can add as many ElseIf clauses as you need to provide alternative choices. Extensive use of the ElseIf clauses often becomes cumbersome. A better way to choose between several alternatives is the Select Case statement.

Select Case Construct

The Select-Case structure is an alternative to If Then Else for selectively executing one block of statements from among multiple blocks of statements. The Select Case Construct makes code more efficient and readable.

A Select Case structure works with a single test expression that is evaluated once, at the top of the structure. The result of the expression is then compared with the values for each Case in the structure. If there is a match, the block of statements associated with that Case is executed.

For example:
Select Case Document.Form1.CardType.Options(SelectedIndex).Text
Case "MasterCard"
DisplayMCLogo
ValidateMCAccount
Case "Visa"
DisplayVisaLogo
ValidateVisaAccount
Case "American Express"
DisplayAMEXCOLogo
ValidateAMEXCOAccount
Case Else DisplayUnknownImage PromptAgain
End Select
Iterative Constructs


Looping allows to run a group of statements repeatedly. The loop is repeated based on a condition. The loop runs as long as the condition is true. The following looping constructs are available in VBScript.
Do – Loop
While – Wend
For – Next

Do – Loop

Do – Loop statements are used to execute a block of statements based on a condition. The statements are repeated either while a condition is true or until a condition becomes true. While Keyword can be used to check a condition in a Do – Loop construct. The condition can be checked before entering into the loop or after the loop has run at least once.
The basic difference between a “Do while – Loop” and “Do - Loop while” is that the previous one gets executed only when the condition in the while statement holds true where as a “Do – Loop while” gets executed atleast once, because the condition in the while statement gets checked at the end of the first iteration.

While – Wend

The While...Wend statement is provided in VBScript for those who are familiar with its usage. However, because of the lack of flexibility in while...wend, it is recommended that you use Do...Loop instead.

For..Next

The For-Next loop can be used to run a block of statements a specific number of times. For loops use a counter variable whose value is increased or decreased with each repetition of the loop. The Step Keyword is used to increase or decrease the counter variable by the value that is specified along with it. The For-Next statement can be terminated before the counter reaches its end value by using the Exit For statement.
For example:
Dim j, total
For j = 2 To 10 Step 2
total = total + j
Next
MsgBox "The total is " & total

VB Script - 1

What is VBScript?
VBScript is a subset of Visual Basic 4.0 language. It was developed by Microsoft to provide more processing power to Web pages. VBScript can be used to write both server side and client side scripting. (If you already know Visual Basic or Visual Basic for Applications (VBA), VBScript will be very familiar. Even if you do not know Visual Basic, once you learn VBScript, you are on your way to programming with the whole family of Visual Basic languages.)
Data types
VBScript supports only one data type called ‘Variant’. The variant data type is a special kind of data type that can contain different kinds of information. It is the default data type returned by all functions in VBScript. A variant behaves as a number when it is used in a numeric context and as a string when used in a string context. It is possible to make numbers behave as strings by enclosing them within quotes.
Variables
A variable is a placeholder that refers to a memory location that stores program information that may change at run time. A variable is referred to by its name for accessing the value stored or to modify its value.
Variable Declaration
Variables in VBScript can be declared in three ways:
Dim Statement
Public Statement
Private Statement
For example:
Dim No_Passenger

Multiple variables can be declared by separating each variable name with a comma. For example: Dim Top, Left, Bottom, Right

You can also declare a variable implicitly by simply using its name in your script.That is not generally a good practice because you could misspell the variable name in one or more places, causing unexpected results when your script is run. For that reason, the Option Explicit statement is available to require explicit declaration of all variables. The Option Explicit statement should be the first statement in your script.
Note:
Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.

Public statement variables are available to all procedures in all scripts.

Private statement variables are available only to the script in which they are declared.

Naming Convention

There are standard rules for naming variables in VBScript. A variable name:
• Must begin with an alphabetic character.
• Cannot contain an embedded period.
• Must not exceed 255 characters.
• Must be unique in the scope in which it is declared.


Assigning Values to Variables

Values are assigned to variables creating an expression as follows: the variable is on the left side of the expression and the value you want to assign to the variable is on the right. For example: B = 200

Scalar Variables and Array Variables

Much of the time, you only want to assign a single value to a variable you have declared. A variable containing a single value is a scalar variable. Other times, it is convenient to assign more than one related value to a single variable. Then you can create a variable that can contain a series of values. This is called an array variable. Array variables and scalar variables are declared in the same way, except that the declaration of an array variable uses parentheses ( ) following the variable name. In the following example, a single-dimension array containing 11 elements is declared:
Dim A(10)

Although the number shown in the parentheses is 10, all arrays in VBScript are zero-based, so this array actually contains 11 elements. In a zero-based array, the number of array elements is always the number shown in parentheses plus one. This kind of array is called a fixed-size array.

Constants

A constant is a meaningful name that takes the place of a number or a string, and never changes. VBScript in itself has a number of defined intrinsic constants like vbOK, vbCancel, vbTrue, vbFalse and so on.

You create user-defined constants in VBScript using the Const statement. Using the Const statement, you can create string or numeric constants with meaningful names and assign them literal values.
For example:
Const MyString = "This is my string."
Const MyAge = 49
Note that the string literal is enclosed in quotation marks (" "). Also note that constants are public by default.
Within procedures, constants are always private; their visibility can't be changed.

Wednesday, August 4, 2010

How to send a key command to a Web object in QTP

Some Web objects will perform actions when certain key commands, such as ALT+RETURN, are entered. These Web objects do not have a type method associated with them that can be used to replay these keys. How can the key combination be replayed?

________________________________________
Solution: Use the Windows Scripting SendKeys method
1. Create a WScript.Shell object.
2. Activate the browser in which you want to execute the keys.
3. Use the SendKeys method to type the key combination.
Example:
‘ This code executes the CTRL+F key combination (search) on a browser.
Set WshShell = CreateObject(”WScript.Shell”)
WshShell.AppActivate “Put the label of the browser” ‘ Activate the browser window
wait(3)
WshShell.SendKeys “^f” ‘ The caret (^) represents the CTRL key.
wait(2)
object.SendKeys(string)
object A WshShell object.
string The string value indicating the keystroke(s) you want to send.
The SendKeys method will send keystroke(s) to the active window. To send a single character (for example, x), use “x” as the string argument. To send multiple characters (for example, abc), use “abc” as the string argument. You can also send special characters such as SHIFT, CTRL, and ALT, which are represented by the plus sign (+), the caret (^), and the percent sign (%), respectively.
For more information on the SendKeys method and other special keys, such as the backspace or a function key, please refer to the MSDN SendKeys Method page.
====================================================================================================
‘ Name: KeyboardShortCut

‘ Input:
‘ ByRef Key As Variant - The keyboard key to be typed.
‘ ByRef Pane As Variant - The window/pane to type in.
‘ Purpose: To type keyboard input onto the open window.
‘====================================================================================================
Function KeyboardShortCut (Key)
dim obj
Set obj = Window(”Window Name” ).WinObject(”Object”)
obj.type Key
Environment(”LastResult”) = “Success”
End Function
Solution2: Pressing Function keys should be recorded automatically
Directly recording on the application and pressing the Function Keys (F1, F2, etc.) should generate code for replay.
Example:
‘Here is an example recorded against Notepad:
Window(”Notepad”).Activate
Window(”Notepad”).WinEditor(”Edit”).Type micF5
If the above does not work, then you can use DeviceReplay to simulate pressing keyboard keys.
Example:
‘Here is an example that does the same thing above, but used DeviceReplay.
Set obj = CreateObject(”Mercury.DeviceReplay”)
Window(”Notepad”).Activate
obj.PressKey 63
Note:
The PressKey method uses the appropriate ASCII or IBM Scan Code value for the key. “63″ is the IBM Scan Code value for F5.

Sample Selenium Test Suite

TestSuite.html
Test suite for the whole application
Access main page
Login to application
Change address
Logout from application











Open fire fox not selenium IDE and paste this link in the address bar

chrome://selenium-ide/content/selenium/TestRunner.html?baseURL=http://localhost&test=file:///dir/testsuite.html&auto=true



replace http://localhost with the baseURL of your server






Running Test Suite from command line
If you want to run a number of tests from the command line - for example, as an acceptance test step, or as a part of the checkin, you have a couple of options.
1) Selenium RC provides convenient command-line support for running HTML Selenese tests from the command-line or with Ant: http://www.openqa.org/selenium-rc/selenese.html
2) Create a batch file that launches Firefox pointed to the suite. For example, on Windows, my batch file looks like:
"C:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content/selenium/TestRunner.html?test=file:///C:/tests/AllTests.html&auto=true&baseURL=http://mysite.com " -height 900 -width 900

Selenium Commands - Part 9

U

uncheck(locator)
Arguments:
• locator - an element locator
Uncheck a toggle-button (checkbox/radio)


uncheckAndWait(locator)
Generated from uncheck(locator)
Arguments:
• locator - an element locator
Uncheck a toggle-button (checkbox/radio)

Selenium Commands - Part 8

T

type(locator, value)
Arguments:
• locator - an element locator
• value - the value to type
Sets the value of an input field, as though you typed it in.
Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value should be the value of the option selected, not the visible text.


typeAndWait(locator, value)
Generated from type(locator, value)
Arguments:
• locator - an element locator
• value - the value to type
Sets the value of an input field, as though you typed it in.
Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value should be the value of the option selected, not the visible text.


typeKeys(locator, value)
Arguments:
• locator - an element locator
• value - the value to type
Simulates keystroke events on the specified element, as though you typed the value key-by-key.
This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
Unlike the simple "type" command, which forces the specified value into the page directly, this command may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in the field.
In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to send the keystroke events corresponding to what you just typed.


typeKeysAndWait(locator, value)
Generated from typeKeys(locator, value)
Arguments:
• locator - an element locator
• value - the value to type
Simulates keystroke events on the specified element, as though you typed the value key-by-key.
This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
Unlike the simple "type" command, which forces the specified value into the page directly, this command may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in the field.
In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to send the keystroke events corresponding to what you just typed.

Selenium Commands - Part 7

S

select(selectLocator, optionLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• optionLocator - an option locator (a label by default)
Select an option from a drop-down using an option locator.
Option locators provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option, or for asserting that the selected option satisfies a specification). There are several forms of Select Option Locator.
• label=labelPattern: matches options based on their labels, i.e. the visible text. (This is the default.)
o label=regexp:^[Oo]ther
• value=valuePattern: matches options based on their values.
o value=other
• id=id: matches options based on their ids.
o id=option1
• index=index: matches an option based on its index (offset from zero).
o index=2
If no option locator prefix is provided, the default behaviour is to match on label.


selectAndWait(selectLocator, optionLocator)
Generated from select(selectLocator, optionLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• optionLocator - an option locator (a label by default)
Select an option from a drop-down using an option locator.
Option locators provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option, or for asserting that the selected option satisfies a specification). There are several forms of Select Option Locator.
• label=labelPattern: matches options based on their labels, i.e. the visible text. (This is the default.)
o label=regexp:^[Oo]ther
• value=valuePattern: matches options based on their values.
o value=other
• id=id: matches options based on their ids.
o id=option1
• index=index: matches an option based on its index (offset from zero).
o index=2
If no option locator prefix is provided, the default behaviour is to match on label.


selectFrame(locator)
Arguments:
• locator - an element locator identifying a frame or iframe
Selects a frame within the current window. (You may invoke this command multiple times to select nested frames.) To select the parent frame, use "relative=parent" as a locator; to select the top frame, use "relative=top".
You may also use a DOM expression to identify the frame you want directly, like this: dom=frames["main"].frames["subframe"]


selectWindow(windowID)
Arguments:
• windowID - the JavaScript window ID of the window to select
Selects a popup window; once a popup window has been selected, all commands go to that window. To select the main window again, use null as the target.
Selenium has several strategies for finding the window object referred to by the "windowID" parameter.
1.) if windowID is null, then it is assumed the user is referring to the original window instantiated by the browser).
2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed that this variable contains the return value from a call to the JavaScript window.open() method.
3.) Otherwise, selenium looks in a hash it maintains that maps string names to window objects. Each of these string names matches the second parameter "windowName" past to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) (which selenium intercepts).
If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages which identify the names of windows created via window.open (and therefore intercepted by selenium). You will see messages like the following for each window as it is opened:
debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"
In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").


setContext(context, logLevelThreshold)
Arguments:
• context - the message to be sent to the browser
• logLevelThreshold - one of "debug", "info", "warn", "error", sets the threshold for browser-side logging
Writes a message to the status bar and adds a note to the browser-side log.
If logLevelThreshold is specified, set the threshold for logging to that level (debug, info, warn, error).
(Note that the browser-side logs will not be sent back to the server, and are invisible to the Client Driver.)


setCursorPosition(locator, position)
Arguments:
• locator - an element locator pointing to an input element or textarea
• position - the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field.
Moves the text cursor to the specified position in the given input element or textarea. This method will fail if the specified element isn't an input element or textarea.


setCursorPositionAndWait(locator, position)
Generated from setCursorPosition(locator, position)
Arguments:
• locator - an element locator pointing to an input element or textarea
• position - the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field.
Moves the text cursor to the specified position in the given input element or textarea. This method will fail if the specified element isn't an input element or textarea.


setMouseSpeed(pixels)
Arguments:
• pixels - the number of pixels between "mousemove" events
Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10).
Setting this value to 0 means that we'll send a "mousemove" event to every single pixel in between the start location and the end location; that can be very slow, and may cause some browsers to force the JavaScript to timeout.
If the mouse speed is greater than the distance between the two dragged objects, we'll just send one "mousemove" at the start location and then one final one at the end location.


setMouseSpeedAndWait(pixels)
Generated from setMouseSpeed(pixels)
Arguments:
• pixels - the number of pixels between "mousemove" events
Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10).
Setting this value to 0 means that we'll send a "mousemove" event to every single pixel in between the start location and the end location; that can be very slow, and may cause some browsers to force the JavaScript to timeout.
If the mouse speed is greater than the distance between the two dragged objects, we'll just send one "mousemove" at the start location and then one final one at the end location.


setSpeed(value)
Arguments:
• value - the number of milliseconds to pause after operation
Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., the delay is 0 milliseconds.


setSpeedAndWait(value)
Generated from setSpeed(value)
Arguments:
• value - the number of milliseconds to pause after operation
Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., the delay is 0 milliseconds.


setTimeout(timeout)
Arguments:
• timeout - a timeout in milliseconds, after which the action will return with an error
Specifies the amount of time that Selenium will wait for actions to complete.
Actions that require waiting include "open" and the "waitFor*" actions.
The default timeout is 30 seconds.


shiftKeyDown()
Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.


shiftKeyDownAndWait()
Generated from shiftKeyDown()
Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.


shiftKeyUp()
Release the shift key.


shiftKeyUpAndWait()
Generated from shiftKeyUp()
Release the shift key.


storeAlert(variableName)
Generated from getAlert()
Returns:
The message of the most recent JavaScript alert
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert dialog.
NOTE: Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.


storeAlertPresent(variableName)
Generated from isAlertPresent()
Returns:
true if there is an alert
Has an alert occurred?
This function never throws an exception


storeAllButtons(variableName)
Generated from getAllButtons()
Returns:
the IDs of all buttons on the page
Returns the IDs of all buttons on the page.
If a given button has no ID, it will appear as "" in this array.


storeAllFields(variableName)
Generated from getAllFields()
Returns:
the IDs of all field on the page
Returns the IDs of all input fields on the page.
If a given field has no ID, it will appear as "" in this array.


storeAllLinks(variableName)
Generated from getAllLinks()
Returns:
the IDs of all links on the page
Returns the IDs of all links on the page.
If a given link has no ID, it will appear as "" in this array.


storeAllWindowIds(variableName)
Generated from getAllWindowIds()
Returns:
the IDs of all windows that the browser knows about.
Returns the IDs of all windows that the browser knows about.

storeAllWindowNames(variableName)
Generated from getAllWindowNames()
Returns:
the names of all windows that the browser knows about.
Returns the names of all windows that the browser knows about.


storeAllWindowTitles(variableName)
Generated from getAllWindowTitles()
Returns:
the titles of all windows that the browser knows about.
Returns the titles of all windows that the browser knows about.


storeAttribute(attributeLocator, variableName)
Generated from getAttribute(attributeLocator)
Arguments:
• attributeLocator - an element locator followed by an
Returns:
the value of the specified attribute
Gets the value of an element attribute.


storeAttributeFromAllWindows(attributeName, variableName)
Generated from getAttributeFromAllWindows(attributeName)
Arguments:
• attributeName - name of an attribute on the windows
Returns:
the set of values of this attribute from all known windows.
Returns every instance of some attribute from all known windows.


storeBodyText(variableName)
Generated from getBodyText()
Returns:
the entire text of the page
Gets the entire text of the page.


storeChecked(locator, variableName)
Generated from isChecked(locator)
Arguments:
• locator - an element locator pointing to a checkbox or radio button
Returns:
true if the checkbox is checked, false otherwise
Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.


storeConfirmation(variableName)
Generated from getConfirmation()
Returns:
the message of the most recent JavaScript confirmation dialog
Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command. If an confirmation is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.


storeConfirmationPresent(variableName)
Generated from isConfirmationPresent()
Returns:
true if there is a pending confirmation
Has confirm() been called?
This function never throws an exception


storeCookie(variableName)
Generated from getCookie()
Returns:
all cookies of the current page under test
Return all cookies of the current page under test.


storeCursorPosition(locator, variableName)
Generated from getCursorPosition(locator)
Arguments:
• locator - an element locator pointing to an input element or textarea
Returns:
the numerical position of the cursor in the field
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.
Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243.
This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.


storeEditable(locator, variableName)
Generated from isEditable(locator)
Arguments:
• locator - an element locator
Returns:
true if the input element is editable, false otherwise
Determines whether the specified input element is editable, ie hasn't been disabled. This method will fail if the specified element isn't an input element.


storeElementHeight(locator, variableName)
Generated from getElementHeight(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
height of an element in pixels
Retrieves the height of an element


storeElementIndex(locator, variableName)
Generated from getElementIndex(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
of relative index of the element to its parent (starting from 0)
Get the relative index of an element to its parent (starting from 0). The comment node and empty text node will be ignored.


storeElementPositionLeft(locator, variableName)
Generated from getElementPositionLeft(locator)
Arguments:
• locator - an element locator pointing to an element OR an element itself
Returns:
of pixels from the edge of the frame.
Retrieves the horizontal position of an element


storeElementPositionTop(locator, variableName)
Generated from getElementPositionTop(locator)
Arguments:
• locator - an element locator pointing to an element OR an element itself
Returns:
of pixels from the edge of the frame.
Retrieves the vertical position of an element


storeElementPresent(locator, variableName)
Generated from isElementPresent(locator)
Arguments:
• locator - an element locator
Returns:
true if the element is present, false otherwise
Verifies that the specified element is somewhere on the page.


storeElementWidth(locator, variableName)
Generated from getElementWidth(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
width of an element in pixels
Retrieves the width of an element


storeEval(script, variableName)
Generated from getEval(script)
Arguments:
• script - the JavaScript snippet to run
Returns:
the results of evaluating the snippet
Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.
Note that, by default, the snippet will run in the context of the "selenium" object itself, so this will refer to the Selenium object, and window will refer to the top-level runner test window, not the window of your application.
If you need a reference to the window of your application, you can refer to this.browserbot.getCurrentWindow() and if you need to use a locator to refer to a single element in your application page, you can use this.browserbot.findElement("foo") where "foo" is your locator.


storeEval(script, variableName)
Generated from getEval(script)
Arguments:
• script - the JavaScript snippet to run
Returns:
the results of evaluating the snippet
Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.
Note that, by default, the snippet will run in the context of the "selenium" object itself, so this will refer to the Selenium object, and window will refer to the top-level runner test window, not the window of your application.
If you need a reference to the window of your application, you can refer to this.browserbot.getCurrentWindow() and if you need to use a locator to refer to a single element in your application page, you can use this.browserbot.findElement("foo") where "foo" is your locator.


storeExpression(expression, variableName)
Generated from getExpression(expression)
Arguments:
• expression - the value to return
Returns:
the value passed in
Returns the specified expression.
This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.


storeHtmlSource(variableName)
Generated from getHtmlSource()
Returns:
the entire HTML source
Returns the entire HTML source between the opening and closing "html" tags.


storeLocation(variableName)
Generated from getLocation()
Returns:
the absolute URL of the current page
Gets the absolute URL of the current page.


storeLogMessages(variableName)
Generated from getLogMessages()
Returns:
all log messages seen since the last call to this API
Return the contents of the log.
This is a placeholder intended to make the code generator make this API available to clients. The selenium server will intercept this call, however, and return its recordkeeping of log messages since the last call to this API. Thus this code in JavaScript will never be called.
The reason I opted for a servercentric solution is to be able to support multiple frames served from different domains, which would break a centralized JavaScript logging mechanism under some conditions.


storeMouseSpeed(variableName)
Generated from getMouseSpeed()
Returns:
the number of pixels between "mousemove" events during dragAndDrop commands (default=10)
Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10).


storeOrdered(locator1, locator2, variableName)
Generated from isOrdered(locator1, locator2)
Arguments:
• locator1 - an element locator pointing to the first element
• locator2 - an element locator pointing to the second element
Returns:
true if two elements are ordered and have same parent, false otherwise
Check if these two elements have same parent and are ordered. Two same elements will not be considered ordered.


storePrompt(variableName)
Generated from getPrompt()
Returns:
the message of the most recent JavaScript question prompt
Retrieves the message of a JavaScript question prompt dialog generated during the previous action.
Successful handling of the prompt requires prior execution of the answerOnNextPrompt command. If a prompt is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript prompts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.


storePromptPresent(variableName)
Generated from isPromptPresent()
Returns:
true if there is a pending prompt
Has a prompt occurred?
This function never throws an exception


storeSelectOptions(selectLocator, variableName)
Generated from getSelectOptions(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all option labels in the specified select drop-down
Gets all option labels in the specified select drop-down.


storeSelectedId(selectLocator, variableName)
Generated from getSelectedId(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
the selected option ID in the specified select drop-down
Gets option element ID for selected option in the specified select element.


storeSelectedIds(selectLocator, variableName)
Generated from getSelectedIds(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all selected option IDs in the specified select drop-down
Gets all option element IDs for selected options in the specified select or multi-select element.


storeSelectedIndex(selectLocator, variableName)
Generated from getSelectedIndex(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
the selected option index in the specified select drop-down
Gets option index (option number, starting at 0) for selected option in the specified select element.


storeSelectedIndexes(selectLocator, variableName)
Generated from getSelectedIndexes(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all selected option indexes in the specified select drop-down
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.


storeSelectedLabel(selectLocator, variableName)
Generated from getSelectedLabel(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
the selected option label in the specified select drop-down
Gets option label (visible text) for selected option in the specified select element.


storeSelectedLabels(selectLocator, variableName)
Generated from getSelectedLabels(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all selected option labels in the specified select drop-down
Gets all option labels (visible text) for selected options in the specified select or multi-select element.


storeSelectedValue(selectLocator, variableName)
Generated from getSelectedValue(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
the selected option value in the specified select drop-down
Gets option value (value attribute) for selected option in the specified select element.


storeSelectedValues(selectLocator, variableName)
Generated from getSelectedValues(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all selected option values in the specified select drop-down
Gets all option values (value attributes) for selected options in the specified select or multi-select element.


storeTable(tableCellAddress, variableName)
Generated from getTable(tableCellAddress)
Arguments:
• tableCellAddress - a cell address, e.g. "foo.1.4"
Returns:
the text from the specified cell
Gets the text from a cell of a table. The cellAddress syntax tableLocator.row.column, where row and column start at 0.


storeText(locator, variableName)
Generated from getText(locator)
Arguments:
• locator - an element locator
Returns:
the text of the element
Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.



storeTextPresent(pattern, variableName)
Generated from isTextPresent(pattern)
Arguments:
• pattern - a pattern to match with the text of the page
Returns:
true if the pattern matches the text, false otherwise
Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.


storeTitle(variableName)
Generated from getTitle()
Returns:
the title of the current page
Gets the title of the current page.


storeValue(locator, variableName)
Generated from getValue(locator)
Arguments:
• locator - an element locator
Returns:
the element value, or "on/off" for checkbox/radio elements
Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.


storeVisible(locator, variableName)
Generated from isVisible(locator)
Arguments:
• locator - an element locator
Returns:
true if the specified element is visible, false otherwise
Determines if the specified element is visible. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one if its ancestors. This method will fail if the element is not present.


storeWhetherThisFrameMatchFrameExpression(currentFrameString, target, variableName)
Generated from getWhetherThisFrameMatchFrameExpression(currentFrameString, target)
Arguments:
• currentFrameString - starting frame
• target - new frame (which might be relative to the current one)
Returns:
true if the new frame is this code's window
Determine whether current/locator identify the frame containing this running code.
This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" frame. In this case, when the test calls selectFrame, this routine is called for each frame to figure out which one has been selected. The selected frame will return true, while all others will return false.


storeWhetherThisWindowMatchWindowExpression(currentWindowString, target, variableName)
Generated from getWhetherThisWindowMatchWindowExpression(currentWindowString, target)
Arguments:
• currentWindowString - starting window
• target - new window (which might be relative to the current one, e.g., "_parent")
Returns:
true if the new window is this code's window
Determine whether currentWindowString plus target identify the window containing this running code.
This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" window. In this case, when the test calls selectWindow, this routine is called for each window to figure out which one has been selected. The selected window will return true, while all others will return false.


submit(formLocator)
Arguments:
• formLocator - an element locator for the form you want to submit
Submit the specified form. This is particularly useful for forms without submit buttons, e.g. single-input "Search" forms.


submitAndWait(formLocator)
Generated from submit(formLocator)
Arguments:
• formLocator - an element locator for the form you want to submit
Submit the specified form. This is particularly useful for forms without submit buttons, e.g. single-input "Search" forms.

Selenium Commands - Part 6

R


refresh()
Simulates the user clicking the "Refresh" button on their browser.


refreshAndWait()
Generated from refresh()
Simulates the user clicking the "Refresh" button on their browser.


removeAllSelections(locator)
Arguments:
• locator - an element locator identifying a multi-select box
Unselects all of the selected options in a multi-select element.


removeAllSelectionsAndWait(locator)
Generated from removeAllSelections(locator)
Arguments:
• locator - an element locator identifying a multi-select box
Unselects all of the selected options in a multi-select element.


removeSelection(locator, optionLocator)
Arguments:
• locator - an element locator identifying a multi-select box
• optionLocator - an option locator (a label by default)
Remove a selection from the set of selected options in a multi-select element using an option locator. @see #doSelect for details of option locators


removeSelectionAndWait(locator, optionLocator)
Generated from removeSelection(locator, optionLocator)
Arguments:
• locator - an element locator identifying a multi-select box
• optionLocator - an option locator (a label by default)
Remove a selection from the set of selected options in a multi-select element using an option locator. @see #doSelect for details of option locators

Selenium Commands - Part 5

O



open(url)
Arguments:
• url - the URL to open; may be relative or absolute
Opens an URL in the test frame. This accepts both relative and absolute URLs. The "open" command waits for the page to load before proceeding, ie. the "AndWait" suffix is implicit. Note: The URL must be on the same domain as the runner HTML due to security restrictions in the browser (Same Origin Policy). If you need to open an URL on another domain, use the Selenium Server to start a new browser session on that domain.


openWindow(url, windowID)
Arguments:
• url - the URL to open, which can be blank
• windowID - the JavaScript window ID of the window to select
Opens a popup window (if a window with that ID isn't already open). After opening the window, you'll need to select it using the selectWindow command.
This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").


openWindowAndWait(url, windowID)
Generated from openWindow(url, windowID)
Arguments:
• url - the URL to open, which can be blank
• windowID - the JavaScript window ID of the window to select
Opens a popup window (if a window with that ID isn't already open). After opening the window, you'll need to select it using the selectWindow command.
This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").






P

pause(waitTime)
Arguments:
• waitTime - the amount of time to sleep (in milliseconds)
Wait for the specified amount of time (in milliseconds)

Selenium Commands - Part 4

W

waitForAlert(pattern)
Generated from getAlert()
Returns:
The message of the most recent JavaScript alert
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert dialog.
NOTE: Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.

waitForAlertNotPresent()
Generated from isAlertPresent()
Returns:
true if there is an alert
Has an alert occurred?
This function never throws an exception
* For ex if we take an application www.jobsahead.com here iam using this command to check for any alerts which is not present in an application.
In command box write the command: waitforAlertNotPresent
In Target write the alert which we want to observe
In Value type True
I gave “Girish” in the target which is not present in the application.

waitForAlertPresent()
Generated from isAlertPresent()
Returns:
true if there is an alert
Has an alert occurred?
This function never throws an exception


*waitForAllButtons(pattern)
Generated from getAllButtons()
Returns:
the IDs of all buttons on the page
Returns the IDs of all buttons on the page.
If a given button has no ID, it will appear as "" in this array.
Take an example: www.agencypro.com
If we give invalid user name and password it throws an alert error message which is in Java Script. And if we…………..
waitForAllFields(pattern)
Generated from getAllFields()
Returns:
the IDs of all field on the page
Returns the IDs of all input fields on the page.
If a given field has no ID, it will appear as "" in this array.
Suppose if we take an URL:www.naukri.com and we have to get all fields ID’s
And the
waitForAllLinks(pattern)
Generated from getAllLinks()
Returns:
the IDs of all links on the page
Returns the IDs of all links on the page.
If a given link has no ID, it will appear as "" in this array.

waitForAllWindowIds(pattern)
Generated from getAllWindowIds()
Returns:
the IDs of all windows that the browser knows about.
Returns the IDs of all windows that the browser knows about.

waitForAllWindowNames(pattern)
Generated from getAllWindowNames()
Returns:
the names of all windows that the browser knows about.
Returns the names of all windows that the browser knows about.

waitForAllWindowTitles(pattern)
Generated from getAllWindowTitles()
Returns:
the titles of all windows that the browser knows about.
Returns the titles of all windows that the browser knows about.

waitForAttribute(attributeLocator, pattern)
Generated from getAttribute(attributeLocator)
Arguments:
• attributeLocator - an element locator followed by an
Returns:
the value of the specified attribute
Gets the value of an element attribute.

waitForAttributeFromAllWindows(attributeName, pattern)
Generated from getAttributeFromAllWindows(attributeName)
Arguments:
• attributeName - name of an attribute on the windows
Returns:
the set of values of this attribute from all known windows.
Returns every instance of some attribute from all known windows.

waitForBodyText(pattern)
Generated from getBodyText()
Returns:
the entire text of the page
Gets the entire text of the page.

waitForChecked(locator)
Generated from isChecked(locator)
Arguments:
• locator - an element locator pointing to a checkbox or radio button
Returns:
true if the checkbox is checked, false otherwise
Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.

waitForCondition(script, timeout)
Arguments:
• script - the JavaScript snippet to run
• timeout - a timeout in milliseconds, after which this command will return with an error
Runs the specified JavaScript snippet repeatedly until it evaluates to "true". The snippet may have multiple lines, but only the result of the last line will be considered.
Note that, by default, the snippet will be run in the runner's test window, not in the window of your application. To get the window of your application, you can use the JavaScript snippet selenium.browserbot.getCurrentWindow(), and then run your JavaScript in there

waitForConfirmation(pattern)
Generated from getConfirmation()
Returns:
the message of the most recent JavaScript confirmation dialog
Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command. If an confirmation is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.

waitForConfirmationNotPresent()
Generated from isConfirmationPresent()
Returns:
true if there is a pending confirmation
Has confirm() been called?
This function never throws an exception

waitForConfirmationPresent()
Generated from isConfirmationPresent()
Returns:
true if there is a pending confirmation
Has confirm() been called?
This function never throws an exception

waitForCookie(pattern)
Generated from getCookie()
Returns:
all cookies of the current page under test
Return all cookies of the current page under test.

waitForCursorPosition(locator, pattern)
Generated from getCursorPosition(locator)
Arguments:
• locator - an element locator pointing to an input element or textarea
Returns:
the numerical position of the cursor in the field
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.
Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243.
This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.

waitForEditable(locator)
Generated from isEditable(locator)
Arguments:
• locator - an element locator
Returns:
true if the input element is editable, false otherwise
Determines whether the specified input element is editable, ie hasn't been disabled. This method will fail if the specified element isn't an input element.

waitForElementHeight(locator, pattern)
Generated from getElementHeight(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
height of an element in pixels
Retrieves the height of an element

waitForElementIndex(locator, pattern)
Generated from getElementIndex(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
of relative index of the element to its parent (starting from 0)
Get the relative index of an element to its parent (starting from 0). The comment node and empty text node will be ignored.

waitForElementNotPresent(locator)
Generated from isElementPresent(locator)
Arguments:
• locator - an element locator
Returns:
true if the element is present, false otherwise
Verifies that the specified element is somewhere on the page.

waitForElementPositionLeft(locator, pattern)
Generated from getElementPositionLeft(locator)
Arguments:
• locator - an element locator pointing to an element OR an element itself
Returns:
of pixels from the edge of the frame.
Retrieves the horizontal position of an element

waitForElementPositionTop(locator, pattern)
Generated from getElementPositionTop(locator)
Arguments:
• locator - an element locator pointing to an element OR an element itself
Returns:
of pixels from the edge of the frame.
Retrieves the vertical position of an element

waitForElementPresent(locator)
Generated from isElementPresent(locator)
Arguments:
• locator - an element locator
Returns:
true if the element is present, false otherwise
Verifies that the specified element is somewhere on the page.

waitForElementWidth(locator, pattern)
Generated from getElementWidth(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
width of an element in pixels
Retrieves the width of an element

waitForEval(script, pattern)
Generated from getEval(script)
Arguments:
• script - the JavaScript snippet to run
Returns:
the results of evaluating the snippet
Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.
Note that, by default, the snippet will run in the context of the "selenium" object itself, so this will refer to the Selenium object, and window will refer to the top-level runner test window, not the window of your application.
If you need a reference to the window of your application, you can refer to this.browserbot.getCurrentWindow() and if you need to use a locator to refer to a single element in your application page, you can use this.browserbot.findElement("foo") where "foo" is your locator.

waitForExpression(expression, pattern)
Generated from getExpression(expression)
Arguments:
• expression - the value to return
Returns:
the value passed in
Returns the specified expression.
This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.

waitForHtmlSource(pattern)
Generated from getHtmlSource()
Returns:
the entire HTML source
Returns the entire HTML source between the opening and closing "html" tags.

waitForLocation(pattern)
Generated from getLocation()
Returns:
the absolute URL of the current page
Gets the absolute URL of the current page.

waitForLogMessages(pattern)
Generated from getLogMessages()
Returns:
all log messages seen since the last call to this API
Return the contents of the log.
This is a placeholder intended to make the code generator make this API available to clients. The selenium server will intercept this call, however, and return its recordkeeping of log messages since the last call to this API. Thus this code in JavaScript will never be called.
The reason I opted for a servercentric solution is to be able to support multiple frames served from different domains, which would break a centralized JavaScript logging mechanism under some conditions.

waitForMouseSpeed(pattern)
Generated from getMouseSpeed()
Returns:
the number of pixels between "mousemove" events during dragAndDrop commands (default=10)
Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10).

waitForNotAlert(pattern)
Generated from getAlert()
Returns:
The message of the most recent JavaScript alert
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert dialog.
NOTE: Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.

waitForNotAllButtons(pattern)
Generated from getAllButtons()
Returns:
the IDs of all buttons on the page
Returns the IDs of all buttons on the page.
If a given button has no ID, it will appear as "" in this array.

waitForNotAllFields(pattern)
Generated from getAllFields()
Returns:
the IDs of all field on the page
Returns the IDs of all input fields on the page.
If a given field has no ID, it will appear as "" in this array.

waitForNotAllLinks(pattern)
Generated from getAllLinks()
Returns:
the IDs of all links on the page
Returns the IDs of all links on the page.
If a given link has no ID, it will appear as "" in this array.

waitForNotAllWindowIds(pattern)
Generated from getAllWindowIds()
Returns:
the IDs of all windows that the browser knows about.
Returns the IDs of all windows that the browser knows about.

waitForNotAllWindowNames(pattern)
Generated from getAllWindowNames()
Returns:
the names of all windows that the browser knows about.
Returns the names of all windows that the browser knows about.

waitForNotAllWindowTitles(pattern)
Generated from getAllWindowTitles()
Returns:
the titles of all windows that the browser knows about.
Returns the titles of all windows that the browser knows about.

waitForNotAttribute(attributeLocator, pattern)
Generated from getAttribute(attributeLocator)
Arguments:
• attributeLocator - an element locator followed by an
Returns:
the value of the specified attribute
Gets the value of an element attribute.

waitForNotAttributeFromAllWindows(attributeName, pattern)
Generated from getAttributeFromAllWindows(attributeName)
Arguments:
• attributeName - name of an attribute on the windows
Returns:
the set of values of this attribute from all known windows.
Returns every instance of some attribute from all known windows.

waitForNotBodyText(pattern)
Generated from getBodyText()
Returns:
the entire text of the page
Gets the entire text of the page.

waitForNotChecked(locator)
Generated from isChecked(locator)
Arguments:
• locator - an element locator pointing to a checkbox or radio button
Returns:
true if the checkbox is checked, false otherwise
Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.

waitForNotConfirmation(pattern)
Generated from getConfirmation()
Returns:
the message of the most recent JavaScript confirmation dialog
Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command. If an confirmation is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.

waitForNotCookie(pattern)
Generated from getCookie()
Returns:
all cookies of the current page under test
Return all cookies of the current page under test.

waitForNotCursorPosition(locator, pattern)
Generated from getCursorPosition(locator)
Arguments:
• locator - an element locator pointing to an input element or textarea
Returns:
the numerical position of the cursor in the field
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.
Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243.
This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.

waitForNotEditable(locator)
Generated from isEditable(locator)
Arguments:
• locator - an element locator
Returns:
true if the input element is editable, false otherwise
Determines whether the specified input element is editable, ie hasn't been disabled. This method will fail if the specified element isn't an input element.

waitForNotElementHeight(locator, pattern)
Generated from getElementHeight(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
height of an element in pixels
Retrieves the height of an element

waitForNotElementIndex(locator, pattern)
Generated from getElementIndex(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
of relative index of the element to its parent (starting from 0)
Get the relative index of an element to its parent (starting from 0). The comment node and empty text node will be ignored.

waitForNotElementPositionLeft(locator, pattern)
Generated from getElementPositionLeft(locator)
Arguments:
• locator - an element locator pointing to an element OR an element itself
Returns:
of pixels from the edge of the frame.
Retrieves the horizontal position of an element

waitForNotElementPositionTop(locator, pattern)
Generated from getElementPositionTop(locator)
Arguments:
• locator - an element locator pointing to an element OR an element itself
Returns:
of pixels from the edge of the frame.
Retrieves the vertical position of an element

waitForNotElementWidth(locator, pattern)
Generated from getElementWidth(locator)
Arguments:
• locator - an element locator pointing to an element
Returns:
width of an element in pixels
Retrieves the width of an element

waitForNotEval(script, pattern)
Generated from getEval(script)
Arguments:
• script - the JavaScript snippet to run
Returns:
the results of evaluating the snippet
Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.
Note that, by default, the snippet will run in the context of the "selenium" object itself, so this will refer to the Selenium object, and window will refer to the top-level runner test window, not the window of your application.
If you need a reference to the window of your application, you can refer to this.browserbot.getCurrentWindow() and if you need to use a locator to refer to a single element in your application page, you can use this.browserbot.findElement("foo") where "foo" is your locator.

waitForNotExpression(expression, pattern)
Generated from getExpression(expression)
Arguments:
• expression - the value to return
Returns:
the value passed in
Returns the specified expression.
This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.

waitForNotHtmlSource(pattern)
Generated from getHtmlSource()
Returns:
the entire HTML source
Returns the entire HTML source between the opening and closing "html" tags.

waitForNotLocation(pattern)
Generated from getLocation()
Returns:
the absolute URL of the current page
Gets the absolute URL of the current page.

waitForNotLogMessages(pattern)
Generated from getLogMessages()
Returns:
all log messages seen since the last call to this API
Return the contents of the log.
This is a placeholder intended to make the code generator make this API available to clients. The selenium server will intercept this call, however, and return its recordkeeping of log messages since the last call to this API. Thus this code in JavaScript will never be called.
The reason I opted for a servercentric solution is to be able to support multiple frames served from different domains, which would break a centralized JavaScript logging mechanism under some conditions.

waitForNotMouseSpeed(pattern)
Generated from getMouseSpeed()
Returns:
the number of pixels between "mousemove" events during dragAndDrop commands (default=10)
Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10).

waitForNotOrdered(locator1, locator2)
Generated from isOrdered(locator1, locator2)
Arguments:
• locator1 - an element locator pointing to the first element
• locator2 - an element locator pointing to the second element
Returns:
true if two elements are ordered and have same parent, false otherwise
Check if these two elements have same parent and are ordered. Two same elements will not be considered ordered.

waitForNotPrompt(pattern)
Generated from getPrompt()
Returns:
the message of the most recent JavaScript question prompt
Retrieves the message of a JavaScript question prompt dialog generated during the previous action.
Successful handling of the prompt requires prior execution of the answerOnNextPrompt command. If a prompt is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript prompts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.

waitForNotSelectOptions(selectLocator, pattern)
Generated from getSelectOptions(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all option labels in the specified select drop-down
Gets all option labels in the specified select drop-down.

waitForNotSelectedId(selectLocator, pattern)
Generated from getSelectedId(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
the selected option ID in the specified select drop-down
Gets option element ID for selected option in the specified select element.

waitForNotSelectedIds(selectLocator, pattern)
Generated from getSelectedIds(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all selected option IDs in the specified select drop-down
Gets all option element IDs for selected options in the specified select or multi-select element.

waitForNotSelectedIndex(selectLocator, pattern)
Generated from getSelectedIndex(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
the selected option index in the specified select drop-down
Gets option index (option number, starting at 0) for selected option in the specified select element.

waitForNotSelectedIndexes(selectLocator, pattern)
Generated from getSelectedIndexes(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all selected option indexes in the specified select drop-down
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.

waitForNotSelectedLabel(selectLocator, pattern)
Generated from getSelectedLabel(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
the selected option label in the specified select drop-down
Gets option label (visible text) for selected option in the specified select element.

waitForNotSelectedLabels(selectLocator, pattern)
Generated from getSelectedLabels(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
an array of all selected option labels in the specified select drop-down
Gets all option labels (visible text) for selected options in the specified select or multi-select element.

waitForNotSomethingSelected(selectLocator)
Generated from isSomethingSelected(selectLocator)
Arguments:
• selectLocator - an element locator identifying a drop-down menu
Returns:
true if some option has been selected, false otherwise
Determines whether some option in a drop-down menu is selected.

waitForNotTable(tableCellAddress, pattern)
Generated from getTable(tableCellAddress)
Arguments:
• tableCellAddress - a cell address, e.g. "foo.1.4"
Returns:
the text from the specified cell
Gets the text from a cell of a table. The cellAddress syntax tableLocator.row.column, where row and column start at 0.

waitForNotText(locator, pattern)
Generated from getText(locator)
Arguments:
• locator - an element locator
Returns:
the text of the element
Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.

waitForNotTitle(pattern)
Generated from getTitle()
Returns:
the title of the current page
Gets the title of the current page.

waitForNotValue(locator, pattern)
Generated from getValue(locator)
Arguments:
• locator - an element locator
Returns:
the element value, or "on/off" for checkbox/radio elements
Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.

waitForNotVisible(locator)
Generated from isVisible(locator)
Arguments:
• locator - an element locator
Returns:
true if the specified element is visible, false otherwise
Determines if the specified element is visible. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one if its ancestors. This method will fail if the element is not present.

waitForNotWhetherThisFrameMatchFrameExpression(currentFrameString, target, pattern)
Generated from getWhetherThisFrameMatchFrameExpression(currentFrameString, target)
Arguments:
• currentFrameString - starting frame
• target - new frame (which might be relative to the current one)
Returns:
true if the new frame is this code's window
Determine whether current/locator identify the frame containing this running code.
This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" frame. In this case, when the test calls selectFrame, this routine is called for each frame to figure out which one has been selected. The selected frame will return true, while all others will return false.

waitForNotWhetherThisWindowMatchWindowExpression(currentWindowString, target, pattern)
Generated from getWhetherThisWindowMatchWindowExpression(currentWindowString, target)
Arguments:
• currentWindowString - starting window
• target - new window (which might be relative to the current one, e.g., "_parent")
Returns:
true if the new window is this code's window
Determine whether currentWindowString plus target identify the window containing this running code.
This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" window. In this case, when the test calls selectWindow, this routine is called for each window to figure out which one has been selected. The selected window will return true, while all others will return false.

windowFocus(windowName)
Arguments:
• windowName - name of the window to be given focus
Gives focus to a window

windowFocusAndWait(windowName)
Generated from windowFocus(windowName)
Arguments:
• windowName - name of the window to be given focus
Gives focus to a window

windowMaximize(windowName)
Arguments:
• windowName - name of the window to be enlarged
Resize window to take up the entire screen

windowMaximizeAndWait(windowName)
Generated from windowMaximize(windowName)
Arguments:
• windowName - name of the window to be enlarged
Resize window to take up the entire screen