Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to access webtables without adding into Object Repository
#1
Not Solved
Hi everybody,

My Scenario is as follows:

I have got a webpage which has got nearly 240 webtables. If the webtable count is going to be static, i would have added those into object repository. But, here, it changes daily. It may increase or decrease.

Each webtable has got few webelements and one image icon. I have verify the content of webelement and then click its image to open required page.

How can i do these without adding webtables in object Repository.

If there is any way of adding webtables dynamically to object repository. please suggest that also.

Thanks in advance,
Ramkumar A D
Reply
#2
Not Solved
Hi,

Use descriptive programing for this.
Count the number of webtables in a webpage navigate either to all webtable or to the specific according to ur need and perform the action.

Hope this help you.

Regards,
Sankalp
Reply
#3
Not Solved
Here is my code:

In the below code webtable("GBS") has to be replaced with new value of str for each for loop.

Issue is : How to add these webtables to object repository. Because i am getting the error as "Object GBS does not exist in object repository..."

Code:
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebTable"
Set EditCollection = Browser("Inoplan2").Page("Inoplan2").Frame("Corpo").ChildObjects(oDesc)
NumberOfEdits = EditCollection.Count
For i = 6 to NumberOfEdits-1
    WebTableTitle = EditCollection(i).GetROProperty("column names")
    str=Mid(WebTableTitle ,2,(instr(2,WebTableTitle ,";")-2))
          'Browser("Inoplan2").Page("Inoplan2").Frame("Corpo").WebTable("GBS") 'Original table name
    Set myobj=Browser("Inoplan2").Page("Inoplan2").Frame("Corpo").WebTable(str)
    myobj.SetTOProperty "name" , EditCollection(i).GetROProperty("name")
    myobj.SetTOProperty "html id" , EditCollection(i).GetROProperty("html id")
    myobj.SetTOProperty "outertext",EditCollection(i).GetROProperty("outertext")
    myobj.RefreshObject
    msgbox myobj.RowCount
    Set myobj = Nothing
Next
Reply
#4
Not Solved
Get the count of the webtables by using GetROProperty and assign the value to variable and use it any where in the script as per your requirement
Reply
#5
Not Solved
HI,

Its not a good idea to add the web tables to the OR as its dynamic in nature.
You need to use descriptive programming with regular expression to define the webtable. In your case you should use descriptive programming for "EditCollection" object and then re-run it. You should not get the error again.

Thanks
Akankhya
Reply
#6
Not Solved
ramkumarad

My understanding:
you have a webpage that has over 200 webtables.
the number of webtables changes daily.
names of the webtables changes daily.

Questions based on any one day:
Are the names of the frames constant?
How many frames are there?
Are all the tables in the same frame?
Within the same frame, what are the unique values, name, html id, outerhtml, etc? (on any one day)
Do all the tables have an image/link? (over 200?)
Is the image/link that you have to click constant or do the names/hrefs change on a daily basis?
In your for/next loop, you are starting from 6 rather than 0(zero) why? just curious.

We can easily find all the tables within a frame. After that, the question is what is a unique element within the tables, number of rows, number of columns, outerhtml, etc or a combination of things?

Parke
Reply
#7
Not Solved
Hey just use regular expression for this issue.like you can use...
Code:
Set EditCollection = Browser(".*").Page(".*").Frame(".*").ChildObjects(oDesc)
Use above line code in your code .Hope it will work for you.
Reply
#8
Not Solved
Hi,
correct me i am wrong. Since you have more than 240 webtables you need to check from the first table ryt?
in the application somewhere it will show the tables count with page numbers ryt? as wells as with next and previous icons as buttons?
try to identify the page number and assign it to table count. then take the row count in each table and check for the required condition for example if the required condition satisfied in 5 row of 17page means do the mentioned action and exit the row count loop and page navigation loop.

got it? if no means mail me ill explain you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question adding two conditions into a while statement lotos 4 5,089 11-10-2017, 04:49 AM
Last Post: lotos
  Uft: Adding a property to all ojects into Repository ProTester 0 1,361 06-09-2017, 12:48 AM
Last Post: ProTester
  adding an object to OR seven 1 2,658 02-17-2014, 02:23 PM
Last Post: basanth27
  which gives better performance qtp with Object repository or qtp without OR. qtpexpert 6 6,573 10-29-2013, 08:56 PM
Last Post: Parke
  Adding Visual Relation id via script to new object jcraig26 1 4,105 06-24-2013, 01:26 PM
Last Post: ourhari

Forum Jump:


Users browsing this thread: 2 Guest(s)