Monday, October 23, 2017

Data Table-Global_reading_Writing

'Data Table
'Reading data from data table

'In data table 2 sheets 

'Global:-
'Local sheet:-

' change in---> setting --->Run--> RUN WITH ONE ITERATION ONLY

'****** Interact with GLOBAL sheet**********
print "start"
'open browser
'loggedin
print datatable("Name")' row 1 
datatable.SetCurrentRow(2)' cursor move to next
print datatable("Name")
datatable.SetCurrentRow(3)
print datatable("Name")
print "end"

' retrive all data using for loop
For i = 1 To datatable.GetRowCount Step 1
    print datatable("Name")
    datatable.SetCurrentRow(i)
    datatable("Country")="India"' wrting data on country column ie INDIA
Next
wait 5 ' it will wait to see the data india in coutry column ,

 'to know the total number of rows
 print datatable.GetRowCount


 'Writing data to datatable

 For i = 1 To 10 Step 1
     datatable.SetCurrentRow(i)
    datatable("Col1")=i                     ' it will write 1 to 10 in col1 
    datatable("Col2")=11-i          ' it will write 10 to 0 in colmn 2
    datatable("Col3")=cint(datatable("Col1"))+cint(datatable("Col2")) 'Adding column 1 and coulumn '2
 
 Next

wait 25

'IN DATATABLE MODIFICATIONS WONT DISPLAY ,IT WILL DISPLAY TILL THE TIME OF SCIPT RUNNING,ONCE SCRIPT END IT WILL 
'DISCARD,TO SEE THAT SEE IN RESULT WINDOW

' to add the column to the global sheet
 datatable.GlobalSheet.AddParameter "Test_Col",""
 wait 10'

No comments:

Post a Comment

Description Programming

'==Descriptive Programming language 'creating the common browser and page object  Set  myPage= browser( "creationtime:=0...