GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 188 of 684    Print  
I need some coding help:

I have a section of my application that looks up legal case numbers. So for example, I type 04TR000001 as my case number click GO and it will open the appropriate case.

I have a data sheet with a parameter CASENUM and it has about 50 case numbers

I now need to be able to verify the right case has opened. There is a bunch of case header information that comes up when a case is opened. It includes for example:

--------------------------------------------------------------------
LAKE IN THE HILLS VS. RUBONO, MICHAEL(04TR000001)

Type:Traffic (TR) Filing Date: 02/28/2006
---------------------------------------------------------------------

I tried doing a simple text checkpoint comparision of CASENUM to the text inbetween the parenthesis. LAKE IN THE HILLS VS.

However, that entire first line is not simply text, it is a complex web object called LAKE IN THE HILLS VS.

Inside that web object is a property called INNERTEXT. This contains the entire first line of that text in the header I listed above.

I need to:
1) Retrieve the innertext from the object, getting only the text inside the parentheses.
2) Compare that text to the current CASENUM.
3) If the texts are equal, log the test as PASSED, if NOT log them as FAIL.


I could use some assistance in all three.

  
Total Answers and Comments: 4 Last Update: November 14, 2006     Asked by: waynehazle 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 04, 2006 09:04:13   #1  
D.V.Narasimha Rao        

RE: I need some coding help:I have a secti...

Hi

For this to do u have to use the GETROproperty of the link.sotre it in a string and compare it with the CASENUM.

Since i dont know the page name browser name i will leave empty.

Code:

Dim st

st Browser( ).page( ).webelement( LAKE IN THE HILLS VS. ).getRoProperty( innertext )

if (instr(st CASENUM) > 0) then

msgbox PASSED

else

msgbox Failed

end if

here I gave msgbox to display them u convert them according to ur application.

Onething important here is the getROproperty

Any doubts feel free to ask

Thanks

D.V.Narasimha Rao


 
Is this answer useful? Yes | No
April 04, 2006 13:37:27   #2  
chvenu Member Since: March 2006   Contribution: 16    

RE: I need some coding help:I have a secti...

i want to get the data in brackets the brackets may be anywhere in line

suppose the line is

India is (developing) country

i want only developing

how to get this used by GetRO property


 
Is this answer useful? Yes | No
April 05, 2006 05:53:25   #3  
D.V.Narasimha Rao        

RE: I need some coding help:I have a secti...

Hi Murthy

For getting the string in the brackets there are several logics...one of them is

code:

Dim st st1 len i j

st India is (developing) country

l1 instr(1 st ( )
l2 instr(1 st ) )
st2 mid(st l1+1 l2-l1-1)

this will geive me the string within the brackets.

This will work for any application

if any doubts plz ask me

Thanks

D.V.Narasimha Rao


 
Is this answer useful? Yes | No
November 14, 2006 05:52:34   #4  
ABC        

RE: I need some coding help:

I have a Query. Pls Help me

I have a combo Box Country . Before this combo box the label exist by the name Country : * combo box

Now where '*' exist I want to generate a message.

I dont want to use Text CheckPoint


 
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