Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help to understand these codes
#1
Solved: 10 Years, 9 Months ago
I am leaning QTP, I have huge and complete framework to practice on. I am trying to build a new one. But Initialization prfocess is vital part to understand. If initializatiion is done I can proceed. Here are some very initial codes from Driver script. Please see the bold line. Here Importing a data sheet from XL. str_driverdatasheet is repeated. Can somebody explain why it is twice?



Code:
RunAction "Initialize_Action", oneIteration

'------Load the driver data sheet and determine the flow----------
str_driverworkbook = Environment ("envFrameworkDir") & "\Datasheets\Functional_Flow.xls"
str_driverdatasheet = "Business_Flow"
DataTable.AddSheet str_driverdatasheet

[color=#0000CD][b]DataTable.ImportSheet str_driverworkbook, str_driverdatasheet, str_driverdatasheet[/b][/color]

Set obj_driversheet = DataTable.Getsheet(str_driverdatasheet)
int_drivernumrow = obj_driversheet.GetRowCount
int_numrow = 1
Reply
#2
Solved: 10 Years, 9 Months ago
@jinnah

I would request you to first refer to QTp help as it will answer most of your queries.

Below is the syntax for Import sheet.

Code:
Datatable.ImportSheet "<FileName>","<SourceSheet>","<destinationSheet>"

Lets look at ur code.

Code:
DataTable.ImportSheet str_driverworkbook, str_driverdatasheet, str_driverdatasheet
str_driverworkbook : is the file name which needs to be imported.
str_driverdatasheet : is the sheetname in the file(str_driverworkbook) which needs to be imported to qtp datatable sheet str_driverdatasheet : is the sheet name in QTP datatable

Regards,
Ankesh
Reply
#3
Solved: 10 Years, 9 Months ago
Great! Thanks

Great! Ankesh Thank you very very much.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I do not understand why my DP is not working. So obvious! chong67 2 1,968 06-25-2012, 08:04 PM
Last Post: chong67
  QTP Test results will return exit codes asrivastava 13 16,237 07-08-2011, 12:57 PM
Last Post: rajpes

Forum Jump:


Users browsing this thread: 1 Guest(s)