Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search WebTable?
#1
Solved: 11 Years, 4 Months ago
Trying to find specific data in a webtable and then clicking on link?

Currently the Webtable has over 400 rows and 7 columns.
The Rows will grow in number but the 7 columns are static.

Example:

Name For, Name By, Type, Action, Date, Status, Details
John, Dave, Test, Add, Date, Status, Link

I need to search the WebTable for a specific row that would meet the search requirements for the Name, Type, and current date...if the row is found and all data matches the search requirement then I will need to click the link in the details column of the same row.


Thanks,
Brian
Reply
#2
Solved: 11 Years, 4 Months ago
you can use WebTable(" ").GetRowWithCellText("The unique item text in the row")
this will give you the row number,
get the link object in the row for the detail column and do the click.

does this help tp solve your issue?

Reply
#3
Solved: 11 Years, 4 Months ago
Saket,

this did help and I think I'm able to find the data with the following...

Code:
If Browser("").Page("").WebTable("").GetRowWithCellText("GD APRS Nine,Internet,Jun 18 2010 4:57PM") = True Then

Browser("").Page("").Link("View").click

End If

(GD APRS Nine , Internet , Date) are from the static columns
GD APRS Nine is a name that is the first search and then type Internet is the second and Date is the third. I think this is right. The problem I'm having is clicking on the View link that is in the last column (Details) of the web table.

Since this page will have a view link at the end of each request
row I will need to be able to click on that link for that specific request I'm looking for.

Problem is that in the object repository the View link is list several times....ie...View, View_2, View_3.....and so on. Is there a way to be able to just click on the link without specifiying the specific object or just click on the link in that row.

And can you review what I have and let me know if it looks correct the way I'm performing my search.

And if I just edit the GetRowWithCellText...data will it perform the search on the new data.


I hope you can understand what I have written.

Thanks for Help.
Reply
#4
Solved: 11 Years, 4 Months ago
Saket -
this may be a risky suggestion as duplicate items will cause issues...Just a thought.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Solved: 11 Years, 4 Months ago
Yes, I agree. Thats why I specified there to use unique text to identify a row. I think this is feasible to implement it here as Brian did it.

Brian - you should use the link object there in identified row and click on it. use DP, dont take it from repository.

Reply
#6
Solved: 11 Years, 4 Months ago
Sorry Saket...

What is DP? and can you give me an example? You are right when I add objects to the repository by learn it captures all View Links and creates objects like View_2, View_3 making it specific to that request.

Thanks for all the help!
Reply
#7
Solved: 11 Years, 4 Months ago
Saket,

Also needed a little follow up on the previous post....

Using the following statement with specific text....if you look at what I have for the GetRowWithCellText- there are 3 elements seperated by commas I'm trying to Identify in a specific row will this work or is it just locating the first string of text "GD APRS Nine"

Code:
Browser("").Page("").WebTable("").GetRowWithCellText("GD APRS Nine,Internet,Jun 18 2010 4:57PM")

And when the test is executed the date field will have to search for current date not a specific date as displayed in the example.

Can you provide me with an example of how I can execute the search of the web table for the row with the 3 elements in the example with date being current date and then to click on the view link using DP?

Thanks for all the help!
Reply
#8
Solved: 11 Years, 4 Months ago
Here is more info on my current issue any help would be greatly appreciated.

Code:
row  =  Browser("").Page("").WebTable("").GetRowWithCellText("GD APRS Nine,Internet,Jun 18 2010 4:57PM", 2, 7)
                    
Set View = Browser("").Page("").WebTable("").ChildItem(3, 7, "Link", 1)

View.Click

This code allows me to click on the link but using the ChildItem you have to specify the row.

My problem is I need to access the row that is in the 7th column of the GetRowWithCellText description.

Tried different variables but no luck....I really need help!

I will also still need to have the script pull the find the request with the most recent date.

Thanks,
Brian
Reply
#9
Solved: 11 Years, 4 Months ago
I am not sure if I am getting you query clearly. why do you need to specify the row when you get this in variable 'row' in the earlier statement.

Reply
#10
Solved: 11 Years, 4 Months ago
Saket,

Sorry for the confusion, I'm able to query the row but when I try to click on the link in the 7th column of that specific row the script is clicking on the wrong obect link "View" because in the object repository there are multiple views....view, view_2.... I do not want to specify that in the code each time. I want the code to just click on the link that is in the 7th column of the query row. The query should find row with cell text and then click on the link in the 7th column.

In an earlier post you mentioned using DP and I wanted to know what that was and could you give me an example of how the query would look with clicking on that link in the 7th column for that specific query.

I hope this helps.

Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CyberArk CorePAS REST API to search for accounts pramod 0 843 06-29-2023, 03:11 PM
Last Post: pramod
  Search All Test scripts For a Function? AndyBSG 1 2,735 02-19-2015, 04:15 AM
Last Post: supputuri
  Search for a string in all the files under all subdirectory Mahesh27 1 2,206 07-03-2013, 03:24 PM
Last Post: Sathiya
  Testing Search box kriday 1 2,531 06-26-2013, 08:51 AM
Last Post: basanth27
  Search for a word in excel string QAVA 6 9,337 11-23-2012, 11:17 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)