Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comparing webtable data with weblist and webelements in other webpage
#1
Not Solved
Hi Guys,

I need script for the following scenarios.

1. Comapring names in a webtable in a webpage with the names in the weblist in another page.

2. Comparing dates in a webtable in a webpage with the dates the dates in other webpage displaying as a webelement

Please help me on this. I need that urgently.
Reply
#2
Not Solved
Arnav:

The following code has not been tested. I would use an arrayList as elements can be added or removed without having to reDim a normal vbscript array.
Code:
Set arrL_1 = dotnetfactory.CreateInstance("System.Collections.ArrayList")
Set arrL_2 = dotnetfactory.CreateInstance("System.Collections.ArrayList")

numRows = browser(b).Page(p).WebTable(nme).RowCount
print "num rows = " & numRows
''assume your column names/header is row one
'' add the names to the first arraylist
for i = 2 to numRows
    arrl_1.add browser(b).page(p).webTable(nme).getCellDate(i,columnNames)
next


'' for a list
'' do not remember if a list count starts with zero or one
list_count = Browser(b).page(p).WebList(listName).getROProperty("items count")
for j = 0 to list_count - 1
    browser(b).page(p).webTable(nme).getCellDate(i,columnNames)
Next

'' you can sort the arrayLists
arrL_1.sort
arrL_2.sort
[\code]


Another method would be to create a strtable and a strList.

[code]
strTable = ""
for i = 2 to numRows
    strTable = strTable & browser(b).page(p).webTable(nme).getCellDate(i,columnNames)
next

strList = ""
for j = 0 to list_count - 1
    strList = strList & "::" & browser(b).page(p).webTable(nme).getCellDate(i,columnNames)
next

'' do a split on the two strings, strList_arr = split(strList,"::") and compare these arrays.

There are lots of examples of how to compare two arrays.
hth,

Parke
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WEBLIST shayk1985 3 5,621 05-17-2018, 11:49 AM
Last Post: Ankur
  webpage WinObject has same name Ananthakumar_S 0 1,700 11-30-2016, 09:48 PM
Last Post: Ananthakumar_S
  Get numbers inside all webelements in webtable and sort them pradeep537 1 2,822 08-04-2016, 01:24 AM
Last Post: Ankur
  Webtable Checkpoint to get cell data from dynamic WbfGrid Neetha 1 3,480 08-20-2015, 11:43 PM
Last Post: ADITI1992
  UFT taking different script execution timings while comparing 2 excel files. sudheer 0 2,356 06-26-2015, 03:28 PM
Last Post: sudheer

Forum Jump:


Users browsing this thread: 1 Guest(s)