Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading Dynamic webtable-WebElement
#1
Solved: 10 Years, 9 Months, 1 Week ago
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
#2
Solved: 10 Years, 9 Months, 1 Week ago
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
#3
Solved: 10 Years, 9 Months, 1 Week ago
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?
#4
Solved: 10 Years, 9 Months, 1 Week ago
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.
#5
Solved: 10 Years, 9 Months, 1 Week ago
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.
#6
Solved: 10 Years, 9 Months, 1 Week ago
You can use the below code to get required dynamic values. Hope this helps...

Code:
strCellData = trim(Browser("Seafight.com – Online").Page("Seafight.com – Online").WebTable("Deutsch").GetCellData(2,3))
strSplitData = split(strCellData," ",3,0)
onlineNow =  strSplitData(0)
Registered =  strSplitData(1)

Thank you,
-Ashok G.
#7
Solved: 10 Years, 9 Months, 1 Week ago
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.
#8
Solved: 10 Years, 9 Months, 1 Week ago
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.
#9
Solved: 10 Years, 9 Months, 1 Week ago
Ahh, i see! Now it works, thank you very much.
#10
Solved: 10 Years, 9 Months, 1 Week ago
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.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading Global Sheet's DataTable Value Bhuvana 0 1,476 01-05-2020, 10:03 PM
Last Post: Bhuvana
  Reading Value from Java Table arjun.singh 8 23,852 10-11-2017, 02:51 PM
Last Post: sivaji
  Reading data from excel sheet serenediva 1 8,895 03-03-2017, 10:07 AM
Last Post: vinod123
Exclamation WebElement("WebElement").Click is not working sia sharma 7 23,222 09-28-2016, 08:58 PM
Last Post: supputuri
  QTP not reading all properties ishan.mahajan@adp.com 2 2,246 05-04-2016, 10:50 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)