Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding a cell Location on a datatable
#1
Not Solved
In am setting up a test. I made edits to the default.xls so that my datatables have the most current copy of the test plan so I do not have to import anything... "it is all there. Now as I perform test and populate the Pass/Fail I am going down the list sequentially and populating based on test results.

Sheet name to TestPlan and the first parameter on that sheet is "Task" and there is a naming convention there. TP01.01, TP01.02, 03 .. and so on.

Issue is when coding it is cell specific, so after a test is preformed it places pass or fail in parameter "PassFail" on the "TestPlan" sheet. However there are folks that want to add, take away and move tasks around.

If I have the result determined in a variable called "TaskResult", is there a way to search a sheet for a task, when found enter the value of TaskResult in the parameter "PassFail" of the row? This way it does not matter the sequence of the Tasks, and it is driven by the written tests that are occurring by the code. If that Task is not coded yet, I can put a default of "NotCoded" in the cell that are left in the PassFail parameter that are blank.

Has anyone done this before? and is there any suggested code that I could use for this? Trying to get a design direction on how to get around having to statically assigning values in a datatable.

Please advise and thanks. -R-

the code that I am thinking is:
Code:
'Not sure how to tell QTP to use the "TP01-TestPlan" action sheet.

row_count = DataTable.GetRowCount
For i=1 to row_count

temp = DataTable.Value("Task_ID")
If temp = "TP01.11" then
     Msgbox("Found It")
     SetCurrentRow(i)
'Need to add here the adding of  whatever the value is of variable "PassFailResult
'in the parameter "PassFail

End If

Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Coloring cell of runtime datatable indranilgoswamimcb 3 10,641 08-03-2012, 03:51 PM
Last Post: SteveS
  help with finding a page using DP mv8167 2 2,299 09-29-2011, 10:44 PM
Last Post: mv8167
MyBB request for VB code for finding X in dynamic web table davidsmi@bossig.com 2 2,918 04-16-2011, 06:40 AM
Last Post: davidsmi@bossig.com
  Finding specific text in a text string janriis 3 5,176 10-08-2010, 04:00 PM
Last Post: KavitaPriyaCR
  Skip a cell while QTP is reading datatable mikee 2 4,224 10-01-2008, 06:05 PM
Last Post: mikee

Forum Jump:


Users browsing this thread: 1 Guest(s)