Hi,

I have a login page. To login in that page I need to have a
valid username and password, which is stored in database. I
imported that table to my DataTable in QTP (Global sheet).
Now I need to write a code in qtp so that I can login only
with valid username and data.

my condition is : I want to get username and password from
inputbox(which i did) and click on login button- which should
verify the datatable for username and password and if value
is present only then lofin else stop the testing.

DataTable contains columns : LoginName and Password

Code:

Rowcount= DataTable.GetSheet("Global").GetRowCount
msgbox "RowCount= " &RowCount,1
CurrentRow= DataTable.SetCurrentRow(1)

Do
Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct
l00$ctl00$UserName$ctl").Set DataTable("LoginName",1)
Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct
l00$ctl00$Password$ctl").Set DataTable("Password",1)
Browser("").Page("").Frame("Frame").Link("Login").Cli
ck
CurrentRow=CurrentRow+1
Loop Until CurrentRow>Rowcount

Can anyone help?

Thanks,
Priya

Answer Posted / sandip mehra

First of all you have to add a sheet at the runtime data
table and then have to import the data from the excel sheet
so for that you have to use import sheet method, then after
follow all your process means you can use your script which
you have written over here.

follow the process and then let me know if you'll get any
error.


Regards
Sandeep Mehra

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi iam shankar here, right now iam working on manual testing. i want to switch over automation tool qtp, right now iam taking training class outside on qtp, please let me know the cost of QTP tool for full version, wether it's an annual subscription or monthly subscription.

1704


How many types of recording modes in qtp? Describe each type with an example where we use them?

605


Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance

1497


What is the use of Debug Viewer?

1482


Could any one tell me "How can i recognize my cursor position using QTP 9.2" Give me a scripts for this

2057






What is keyword driven framework?

610


What are test settings and global settings?

575


wt is the use of multiple questions in QTP

1671


What is checkpoints for quicktest professional (qtp)?

572


what is supply chain management?

2081


I want to know can we integrate visual source safe tool with QTP and QC for our version controlling process? WE know QTP and QC 10.0 version is having the version control inbuilt in it but I want to know the merits and demerits of the inbuilt version control tool and the visual source safe tool using QTP and QC.

2460


I got some information from the QTP help.But i am not sure whether through this process will QTP work or not bellow is the Help what I have Remote setup Settings Remote WSH, which is a new technology included in WSH 5.6, provides the ability to run a script on a remote machine or machines. With Remote WSH, the script is physically copied from the local machine to the remote machine before executing. In order to enable Remote WSH functionality, you must first set up the remote machine with the proper security settings. The steps below perform the tasks that enable Remote WSH. Note Both the remote and local machines must be running Windows NT 4 SP3 or greater in order to use Remote WSH. To enable a machine to run remote scripts 1. Install WSH V5.6 on the machine. If you are using Windows 2001 or have installed Internet Explorer 6 or greater, WSH 5.6 has already been installed. Note WSH 5.6 is available for download from the web at http://msdn.microsoft.com/scripting 2. Add yourself to the remote machine's Local Administrators group. 3. To enable Remote WSH, use Poledit.exe on the server. Note An administrator who wants to enable Remote WSH must either acquire the Windows 2000 resource kit, or use http://msdn.microsoft.com/scripting to acquire the necessary windowsscript.adm file that contains the WSH settings. The windowsscript.adm file must be copied to the server that sets the gapplicabel group's policies. Although it is not necessary to copy the file to the server's \WINNT\INF directory, this is nonetheless where the default adm files are located. Note For more information on Poledit.exe, see the Poledit.exe's online help system. 4. WSH should now be enabled on the machine. To test it,. WSH 5.6 can run scripts that reside on remote systems. The following scripts demonstrate this capability. These scripts make the assumption that the files are located on a local machine directory called "c:\wsh5.6"; change the local path and the remote machine name as necessary. After initially running RemoteTest.WSF on the local machine, there may be a small pause as DCOM verifies your identity. After you see the "Done" message, a file named "c:\beenhere.txt" on the remote machine indicates the time that you executed the command (from the remote computer's clock). Script to run scripts remotely set oController = CreateObject("WSHController") set oProcess= oController.CreateScript("c:\wsh5.6\beenhere.wsf","remmachine") oProcess. Execute Could you tell me will it work fine

1791


How the exception handling can be done using quicktest professional (qtp)?

563


How do we analyze the checkpoint results?

571


What is expert view in qtp?

575