GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 612 of 647    Print  
access a table row based on columns value
I have some information in table. for example
Table table has four columns.
It has two rows with following values in each columns

col1 col2 col3 col4

val val12 val13 link1
val21 val22 val23 link2

I have a value stored in the data table as an out put value lets say val21 from an earlier page

Once I am on this page I want to compare this value to the tables columns values. If I find a match I want to click the corresponding link in that row. The problem is the rows are displayed randomly thats why I cannot hardcode the row value. first I want to find the row which has this value and click the link in the fourth coulm of that row.

please help. Please let me know If you need more clarification on the problem




  
Total Answers and Comments: 2 Last Update: April 15, 2008     Asked by: fullmoon74 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 15, 2008 00:15:32   #1  
NawabShaikh Member Since: January 2007   Contribution: 210    

RE: access a table row based on columns value
There are two Approach for the same.

1. Object Repository

  ''Suppose the Table is captured in OR

   For intCnt = 0 to Browser().Page().Frame().WebTable(Tbl).GetROProperty("row count")
         strVal = Browser().Page().Frame().WebTable(Tbl).GetCellData(1, intCnt+1)
         if strComp(strVal, DataTable.Value("Value", dtLocalSheet)) = 0 then
             ''Please check for the click method :(
         end if
   Next

2. Descriptive Programming

   '''Description of the First Column Element

    Set oVal= Description.Create()
    Set oVal("micclass").Value = "<<Class of the Column Element>>"
    Set oVal("html id").Value = "<<html id of the Column element>>"

    Set TBL_ELEM = Browser().Page().Frame().ChildObjects(oVal)
    
    '''Description of the Link in the Table

    Set oLink = Description.Create()
    Set oLink ("micclass").Value = "<<Class of the Link Element>>"
    Set oLink ("html id").Value = "<<html id of the Link Element>>"

    Set TBL_LINK = Browser().Page().Frame().ChildObjects(oLink)
''''There is an Assumpation that the Link and the Val Element are analogous :)
  strLocVal = Datatable.Value("Value",dtlocalsheet)
  For intCnt = 0 to TBL_ELEM.Count-1
     if strComp(Trim(TBL_ELEM(intCnt).GetROProperty("innertext")),strLocVal  ) = 0 then
     
         TBL_LINK(intCnt).Click
     end if
  Next

 
Is this answer useful? Yes | No
April 15, 2008 16:02:58   #2  
fullmoon74 Member Since: April 2008   Contribution: 2    

RE: access a table row based on columns value
thanks a lot nawab. I will try this tonight an will let you know how it goes.
 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : The below code...will connect to databaseSet xlconn=createobject("ADODB.connection")Set xlrset=createobject("ADODB.recordset")connstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsmavDesktopseshudb1.mdb;User ...
Read Answers (2) | Asked by : ilts

I am testing a Java executable application and and IE based application.I have a script that I would like to launch the Java executable, enter a record in the database, the switch over to IE and search the database. Currently I am having trouble: 1) The java EXE cannot be launched from the QTP command line. So my run settings are run on any open Java application. This is not preferable and right now DEV cannot figure out why QTP can launch other Java apps and not ours. So when I start the script

View Question | Asked by : p_senthil

Can anybody tell me the purpose of output checkpoints in QTP. how u r testing the text data through text checkpoints. how u r testing text data in the webpage through parameterization. my application is web based application. my requirement is i am retriving the data from the database to webpage. i put text checkpoint on the text, but problem is the parameterization. can anybody help me with code. i will appreciate if anybody can say
Read Answers (2) | Asked by : manoj_k3

Which command in QTP Script used to capture real time values?If QTP does not support third party web based application which is to be tested for GUI interface,what will be our next approach?What are configuration management Techniques?Difference between sanity testing and smoke testing? when will we use these testing?Comparision between weights and checkpoints.what is batch Testing?What is the difference between object identification and Object Repository?
Read Answers (3) | Asked by : kulgu

How to write QTP script to exit from loop? suppose I am using parametize functionality and in data table there is 3 password corresponding 3 username and second pasword is wrong. Now I want to exit after completion of second iteration and continue with third iteration.
Read Answers (3) | Asked by : Ravi kumar

Hi,I wanted know how does QTP identifies a DataCombo. While recording I clicked on the data combo and selected a value from the list. The click of Data Combo is recorded but the selection of the value from the list is not recorded. My application is based on VB and SQL server as the database. Please let me know as how do I record the action of selecting a value from a DataCombo list. The list is being loaded from the Database Record set.

Hi,I am testing an Add Employee screen.In the same screen the user has an option to upload the image of the Employee.Now the problem is i am able to record the upload operation and i close the screen once it is been uploaded.Now when i run the Test..Qtp fails to perform the Upload Operation...meanwhile jumps to a new record in the Data table(i have parameterised few fields).Pls help...Thnx in Advance...
Read Answers (1) | Asked by : Shankar

Hi,I am using QTP 8.2. I am trying to record an application (web based) which involves clicking on graphs. Does QTP recognise graphs and what do you mean virtual objects.
Read Answers (1) | Asked by : Balaji

Hi I am using QTP for Testing a Web Application.I want to click an object that has the property of table Onclick event of that application moves the element to to some other position(Top) in that table..Now When I Record and Run the Script the object discriptio has changed .....Since I have a Unique name for my object I could have used it..But It is not a plain text and insert text checkpoint throws me error saying object not found I can use only text check point How To use the same for a event


 Sponsored Links

 
Related Articles

Performing DML Operations on XML Schema Based XMLType Views

Performing DML Operations on XML Schema Based XMLType Views Analyzing the underlying query of the empSch v view discussed in the preceding section you may note that each attribute of the EMP T object used in the select list maps to a certain column of a single table namely emps What this means in pr
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php&quot; document ready function var highlighted
 

jQuery Expanding and Collapsing Table Rows

jQuery Expanding and Collapsing Table Rows The expanding and collapsing behavior added earlier also conflicts with our filters If a section is collapsed and a new filter is chosen then the matching items are displayed even if in the collapsed section Conversely if the table is filtered and a section
 

jQuery Table Row Filtering

jQuery Table Row Filtering Earlier we examined sorting and paging as techniques for helping users focus on relevant portions of a table s data We saw that both could be implemented either with server side technology or with JavaScript Filtering completes this arsenal of data arrangement strategies B
 

jQuery Collapsing and Expanding Table Rows

jQuery Collapsing and Expanding Table Rows When large sets of data are grouped in tables as each year s set of articles are in our News page collapsing or hiding a section s contents can be a convenient way to get a broad view of all of the table s data without having to scroll so much mosgoogle To
 

jQuery Table Manipulation

Learning jQuery Table Manipulation By Karl Swedberg Jonathan Chaffer Better Interaction Design and Web Development with Simple JavaScript Techniques Learning jQuery packtpub com jQuery book Table Manipulation Let em wear gaudy colors Or avoid display Devo Wiggly World&quot; In the first si
 

N-Tier Architecture: Data Access Layer

N Tier Architecture Data Access Layer In an N Tier architecture the data access layer consists of components that aid one in the process of accessing the database When it is used correctly the data access layer serves as an abstract level for the structures of the database Simple changes that are ma
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and&nbsp; scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

What are Data Access Tools

Data access is the process of entering a database to store or retrieve data. Data Access Tools are end user oriented tools that allow users to build structured query language (SQL) queries by pointing and clicking on the list of table and fields in the data warehouse. Thorough computing history, t
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape