Option Explicit
Set FsoObject=CreateObject("Excel.Application")
FsoObject.Workbooks.Open Sheetpath
Set Excelsheet=FsoObject.ActiveWorkbook.Worksheets("Sheet1")
Row_Count=FsoObject.ActiveSheet.UsedRange.Rows.Count
For i=1 to Row_Count
UserId=FsoObject.Cells(i,1).value
Pwd =FsoObject.Cells(i,2).value
Browser("...").Page("...").WebEdit("UserId").Set UserId
Browser("...").Page("...").WebEdit("Password").Set Pwd
Browser("...").Page("...").WebButton("Login").Click
LoginText=Browser("...").Page("...").WebEdit("text").GetROProperty("text")
Excelsheet.Cells(i,3)=LoginText
Loop
FsoObject.ActiveWorkbook.Save
FsoObject.Application.Quit
Set FsoObject=nothing
Fetching Test Data from DataBase and Setting into Application Fields.
Option Explicit
Dim path, app, Sheets, row, UserId, Pwd
Set app=CreateObject("ADODB.Connection")
Set rec=CreateObject("ADODB.Recordset")
app.Open "Provider=SQLQLEDB;Server=.\SQLEXPRESS;UserId=test;Password=P@123;Database =AUTODB"
rec.LockType=3
rec.Open "Select * from LoginData",app
Do while rec.EOF<> True
UserId=rec.Fields.Item("UserName")
Pwd=rec.Fields.Item("PassWord")
Browser("...").Page("...").WebEdit("UserId").Set UserId
Browser("...").Page("...").WebEdit("Password").Set Pwd
Browser("...").Page("...").WebButton("Login").Click
LoginText=Browser("...").Page("...").WebEdit("text").GetROProperty ("text")
rec.Fields.Item("StatusMessage").Value=LoginText
rec.Update
rec.MoveNext
Loop
app.Close
rec.Close
Set app=Nothing
Set rec=Nothing
Dim Sheetpath, FsoObject, Excelsheet, rowNumber, UserId,Pwd, SheetCells, Row_Count, i
Sheetpath="D:\testdata.xlsx"Set FsoObject=CreateObject("Excel.Application")
FsoObject.Workbooks.Open Sheetpath
Set Excelsheet=FsoObject.ActiveWorkbook.Worksheets("Sheet1")
Row_Count=FsoObject.ActiveSheet.UsedRange.Rows.Count
For i=1 to Row_Count
UserId=FsoObject.Cells(i,1).value
Pwd =FsoObject.Cells(i,2).value
Browser("...").Page("...").WebEdit("UserId").Set UserId
Browser("...").Page("...").WebEdit("Password").Set Pwd
Browser("...").Page("...").WebButton("Login").Click
LoginText=Browser("...").Page("...").WebEdit("text").GetROProperty("text")
Excelsheet.Cells(i,3)=LoginText
Loop
FsoObject.ActiveWorkbook.Save
FsoObject.Application.Quit
Set FsoObject=nothing
Fetching Test Data from DataBase and Setting into Application Fields.
Option Explicit
Dim path, app, Sheets, row, UserId, Pwd
Set app=CreateObject("ADODB.Connection")
Set rec=CreateObject("ADODB.Recordset")
app.Open "Provider=SQLQLEDB;Server=.\SQLEXPRESS;UserId=test;Password=P@123;Database =AUTODB"
rec.LockType=3
rec.Open "Select * from LoginData",app
Do while rec.EOF<> True
UserId=rec.Fields.Item("UserName")
Pwd=rec.Fields.Item("PassWord")
Browser("...").Page("...").WebEdit("UserId").Set UserId
Browser("...").Page("...").WebEdit("Password").Set Pwd
Browser("...").Page("...").WebButton("Login").Click
LoginText=Browser("...").Page("...").WebEdit("text").GetROProperty ("text")
rec.Fields.Item("StatusMessage").Value=LoginText
rec.Update
rec.MoveNext
Loop
app.Close
rec.Close
Set app=Nothing
Set rec=Nothing
No comments:
Post a Comment
Note: only a member of this blog may post a comment.