Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import form excel file
#1
Not Solved
i used a file excel to import into datatable. The column name in the excel file matched the parameter name in my test, and the sheet in the excel file matched the action name in my test too. In the excel file, i have two data row. but when i run my test, i just get the result for the first data row.
can you explain for me Sad
Reply
#2
Not Solved
Hi Sekhan,

When you import the data from external source i.e Excel sheet always first row data will treat as parameters in data table.

Ex: If you have 2 rcords in excel then first record data is the parameter name in the data table.


Please let me know for futher clarification.



Regards,
Venkat. Batchu
Reply
#3
Not Solved Wink 
Hi Sekhan,

Select "Run For All Rows" from "test settings-> Run".

Hope it wil work...
Smile
Reply
#4
Not Solved
hi saini
my test is always selected "run on all rows" but it does not work exactly too

hi venkatbatchu
i am using qtp9.2 and ie7
in my excel file, first row is "user" --> param name in datatable
second row is first record
third row is second record.
and when i run the test, it run the first record in 2 interations without running the second record
Reply
#5
Not Solved Wink 
Hi sekhan,

I need few more details about your test:

1) Are you entering the data in global data sheet?

2) If no, are you using some external action and talking about action sheet?

Smile
Reply
#6
Not Solved
no, global sheet in datatable is null, all records are stored in excel file
this is all of scripts in my project:
Code:
Datatable.Import("D:\Software Quality Control\pncbookstore\Login.xls")

Browser("Browser").Page("Online").Link("Login").Click
Browser("Browser").Page("Login_Online").WebEdit("user_login").Set DataTable("user", dtGlobalSheet)
Browser("Browser").Page("Login_Online").WebEdit("user_login").SetTOProperty "value", DataTable("user", dtGlobalSheet)
strMail = Browser("Browser").Page("Login_Online").WebEdit("user_login").GetTOProperty("value")
Browser("Browser").Page("Login_Online").WebEdit("password").SetSecure "3c32f2445bbc7481db3492b1d1556ceb7fdf9e03ca7be253143d"
If strMail = "d_quangvu@yahoo.com" Then
    Browser("Browser").Page("Login_Online").WebButton("Login").Click
    Browser("Browser").Page("Online").Link("Logout").Click
else
    reporter.ReportEvent micFail, "Failed Report","..."
End If
Browser("Browser").Close
Reply
#7
Not Solved
i have the script

Code:
datatable.import("...")
For i = 1 to Datatable.GetRowCount
DataTable.SetCurrentRow(i)
datatable.GetCurrentRow
...
datatable.setnextrow
next

my datatable have 2 record (imported from excel file). i see when i run my action, it will run 2 iterations, and in a iteration it run 2 record too. i want my action just run 1 record for 1 iteration. how must i do? Sad
help me please
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to export the output value of a webedit object to a new excel file. mounika6677 1 1,531 04-14-2019, 05:18 PM
Last Post: mounika6677
  Access not saved excel file randhirsinghskhn 0 1,038 09-04-2018, 07:26 AM
Last Post: randhirsinghskhn
  Can we test Salesforce Standard form using QTP? yona34 0 1,078 05-22-2018, 10:57 AM
Last Post: yona34
  dtLocalSheet empty even though excel file contains data cantorre 2 2,434 05-10-2017, 12:47 PM
Last Post: vidhi
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,861 01-17-2017, 04:05 PM
Last Post: sagar.raythatha

Forum Jump:


Users browsing this thread: 1 Guest(s)