When data is entered into the data table it automatically formats the value using the best possible matching format. For example, if "12345678901" is entered into a cell then it would be auto formatted to "1.23456789E+010". In situations where the formats are important the data should be entered with care. If data entered in the cell start with a single quote (') then it is always treated as a text and no format conversion is performed.
We can also define a specific format by right clicking the cell or an entire column and then picking a specific format from the popup context menu.
Problem : How to access a parameter from the global data sheet There are a variety of ways to access a parameter from the global data table,most of which are presented in the following code snippet:
Problem, How to access a parameter from a Local data sheet'Various methods to get data table value
Problem . How to check if a Sheet exists'Function to check if DataTable sheet exists Function isSheetExists(sheetName) On error resume next
Problem. How to preserve format of data output to a data table'This would be modified to 1.23456789E+010 due to auto formatting DataTable
Problem . How to export contents of a WebTable to a data sheet. Let's assume that the first row of the data table contains the columns heading. We then add those as parameters of the data table:'Variable declaration Dim i.j
'We are using index here to avoid >the problem of 'the "_." issue if cell text has spaces or new line chars 'then we will get an error, to overcome that we can also use 'outSheet.GetParameter(Replace(cellText," ","_")).Value outSheet.GetParameter(j-l).value = cellTextNext Next
Problem. How to get value of a parameter from any specific row in the data table.
We use the ValueByRow method to get value for any row 'Get a value by row'Get a value by row
Problem . How to execute a script for all Global Data Table iterations, when the script is set to run for only one iteration:In case we want to manually repeat the cod/ for each iteration, we need to write a bit code.
Problem . How to get the number of columns that contain data:To solve this problem we need to utilize the excel formula COUNTA. We add a parameter to the data table with the formula and then read its value:
'Get the new value
Using Qtp Help
Qtp Environment Variables
Descriptive Programming (dp)
Debugging In Qtp
Working With Apis
Qtp Automation Object Model
Working With Xml
Working With Databases
Working With Microsoft Excel
Working With Microsoft Outlook
Working With Microsoft Word
Working With Microsoft Internet Explorer
Working With Hp Quality Center
Working With .net Classes
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.