GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 604 of 684    Print  
How to save User Defined Data in Global Data Sheet
Hi,
Can I save my user defined variable value in a Data Sheet ?

Dim textValue
textValue= Browser("Browser").Page("Pag1").WebEdit("WebEdit").GetROProperty("innertext")

I want to save textValue in a column in Global Data Sheet. Then I want to compare this column with another column.

Is that possible ?
Thanks
Sairam




  
Total Answers and Comments: 6 Last Update: January 13, 2008     Asked by: sairam100 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 20, 2007 20:17:49   #1  
vigneshtarun Member Since: August 2007   Contribution: 3    

RE: How to save User Defined Data in Global Data Sheet
If u want the values in the global sheet then just add this line
x Browser("a").Page("a ").WebEdit("a").GetROProperty("value")
datatable.Value("name" global) x
now ur value will be in the datatable.

 
Is this answer useful? Yes | No
December 21, 2007 09:31:48   #2  
sairam100 Member Since: December 2007   Contribution: 9    

RE: How to save User Defined Data in Global Data Sheet
Thank you Vignesh
That was helpful. It worked for me. I have another question now. How can I compare two columns in Data Table ? I am trying to do something like this.

Global Data Table
Col 1 Col 2
xxxx yyyyy
www ttttttt

If Col 1 Col2 then I want to generate a report saying "PASS" else "FAIL"

Thanks
Sairam

 
Is this answer useful? Yes | No
December 22, 2007 09:29:09   #3  
ramugogurla Member Since: January 2007   Contribution: 14    

RE: How to save User Defined Data in Global Data Sheet

for ex dim a
a "ramugogurla"
datatable.value("Userdefined" "dtglobalsheet") a

value will come in run time datatable

or use environment variables

goto test settings environment userdefined and daclare u r own variables

and read that with myvalue envirinment.value("ramu")


 
Is this answer useful? Yes | No
December 25, 2007 12:20:26   #4  
vigneshtarun Member Since: August 2007   Contribution: 3    

RE: How to save User Defined Data in Global Data Sheet
hi sai
try this out
a datatable.Value("name1" dtglobal)
b datatable.Value("name2" dtglobal)
If a b Then
reporter.ReportEvent micPass "values r equal" "step3"
else
reporter.ReportEvent micfail "values r not equal" "step3"
End If

ur result will be generated in the testresult window if u want in the test script during runtime itself use msgbox instead of reporterevent.

 
Is this answer useful? Yes | No
January 13, 2008 17:09:11   #5  
newqtp Member Since: January 2008   Contribution: 30    

RE: How to save User Defined Data in Global Data Sheet

Hi sai
Try this
for entering data at run time in your datatable
c "somedata"
datatable("name2" dtglobal) c

and compariing two column this will work
Dim A B
A datatable.Value("Columnname1" dtglobal)
B datatable.Value("Columnname2" dtglobal)
If A B Then
reporter.ReportEvent micPass "values are equal" "step3"
else
reporter.ReportEvent micfail "values Are not equal" "step3"
End If


 
Is this answer useful? Yes | No
January 13, 2008 17:43:02   #6  
newqtp Member Since: January 2008   Contribution: 30    

RE: How to save User Defined Data in Global Data Sheet
here is the code
datatable("columnname" dtgolbal) textvalue

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape