UserName Property (Login Object)

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Gets or sets the user name entered in the browser login dialog.

Declaration

TestObj.UserName

Read-Write Property String
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following object:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

A string containing the user name entered in the login dialog.

Remarks

To enter the user name in the browser login dialog, you can use either the Login.UserName property or the SetText method of the user name input field:

page.Login.UserName = "jsmith"

page.Login.Textbox("UserName").SetText("jsmith")

The difference is that the SetText method posts a message to the test log about text input whereas setting the Login.UserName property value does not post any messages to the test log.

Example

For an example of using the Login.UserName property, see the Login object description.

See Also

Login Object
Password Property (Login Object)
Testing Web Applications
Handling JavaScript Popups and Browser Dialogs

Highlight search results