Micro Focus QTP (UFT) Forums
Help to understand these codes - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Help to understand these codes (/Thread-Help-to-understand-these-codes)



Help to understand these codes - jinnah - 09-17-2012

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



RE: Help to understand these codes - Ankesh - 09-17-2012

@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


RE: Help to understand these codes - jinnah - 09-19-2012

Great! Thanks

Great! Ankesh Thank you very very much.