Posts: 1
Threads: 1
Joined: May 2008
Reputation:
0
05-14-2008, 11:32 PM
(This post was last modified: 05-14-2008, 11:43 PM by ibmexpert.)
How can I read Dynamic webtable-WebElement (generated from table)
example:
USD 099-00106-1 (3,194,980.12) 0.00
USD 099-80063-1 179,163.50 0.00
USD 099-81057-1 155.92 0.00
When I use QTP it is naming WebElement as 099-00106-1, 3,194,980.12, 0.00 (Link), 099-80063-1, 179,163.50, 0.00 (Link) and so on
Posts: 130
Threads: 0
Joined: Jul 2008
Reputation:
0
07-07-2008, 12:58 PM
Even for a Dynamic web Table, they will maintain some unique properties like name or html id. Get to recognise your webtalbe uniquely.
Then your work is done, you can read the table data using GetCellData Function
Posts: 43
Threads: 10
Joined: Jul 2008
Reputation:
0
07-09-2008, 11:07 PM
I have a similar problem.
On the web page is a number displayed. I have to check the number if it's correct. The Problem is that the number is dynamic:
<div style="height:15px;width:180px;margin-top:45px;font-weight:bold;text-align:right;">16.355 </div>
I don't know how to address the shown number to check wether it is right or wrong (for example a negative number or a number that is too high).
In the object spy the number is visible as a webelement: (e.g. 18.422).
The number is visible in the source code like above, because its a server-side filled variable and there is no name or html id, so i'm not able to adress the number.
Is there another way to solve the problem without a html id?
Posts: 130
Threads: 0
Joined: Jul 2008
Reputation:
0
07-10-2008, 01:18 PM
You dont need to identify the WebElement, you have to identify the Parent of the WebElement which is obviously a web table.
Now identify that table with Unique properties and Use GetCellData function to retrieve a value from the Table.
If you have any WebPage let me knwo then i can send you the example.
Posts: 43
Threads: 10
Joined: Jul 2008
Reputation:
0
07-10-2008, 03:24 PM
(This post was last modified: 07-11-2008, 06:03 PM by QADBA.)
The page i'm testing is seafight.com . On this web page i've to check the number of online player (displayed in the right upper corner) and the number of registered user right below.
Posts: 43
Threads: 10
Joined: Jul 2008
Reputation:
0
07-10-2008, 04:46 PM
Thx for your code. I tried to implement your example, but unfortunately i got a run error, because the object wasn't found in the object repository.
With the aid of the object spy, i tried to get a solution. But with no result.
Posts: 10
Threads: 2
Joined: Mar 2008
Reputation:
0
07-10-2008, 06:49 PM
You need to add the object WebTable("Deutsch") to ur OR. Follow the below steps...
1.Open Object Repository
2.In the Object repository Window, navigate to Object>Add Objects to Local
3.Place the pointer on the Web Element 'Online'
4.Now Select WebTable("Deutsch") from the 'Object Selection - Add to Repository' window.
5.Then try running the code.
Posts: 43
Threads: 10
Joined: Jul 2008
Reputation:
0
07-10-2008, 08:00 PM
Ahh, i see! Now it works, thank you very much.
Posts: 43
Threads: 10
Joined: Jul 2008
Reputation:
0
07-10-2008, 09:50 PM
Is it possible to add my results to the Test Result (Automation>Result)?
At the moment i'll display a message if e.g. the shown number of registered user is smaller than the number of user who are online.