Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fetching values from a web table
#1
Solved: 8 Years, 5 Months ago
From attached web table I need to verify all states name are there. I am planing to fetch all states' names and compare with data stored in Excel

Additional: States name are in order
Checkboxes are only available for selected states in licensed column.

Please help.
Reply
#2
Solved: 8 Years, 5 Months ago
Would you post the code you have tried so far?
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
#3
Solved: 8 Years, 5 Months ago
Please try below code to fetch values from webtable:

Code:
Dim a
iRowCount = Browser("Browser").Page("Page").WebTable("WebTable").RowCount
ReDim a(iRowCount - 1)
For iRow = 2 to iRowCount
    a(iRow-2) = Browser("Browser").Page("Page").WebTable("WebTable").GetCellData(iRow,1)
Next

Values will be in array a.
Reply
#4
Solved: 8 Years, 5 Months ago
Hi,

Thanks for your reply, I understood your way to capture the attribute values.
but issue is with selecting the attribute values, I am still not able to select the values from the web element dropdown.

Please suggest me some solution.

Thanks,
Pooja

Hi Basanth,

My code with webtable is :-

Code:
Set rowNum=Browser().Page().Webtable().GetRowWithCellText(ColumnNameAttribute)

Browser().Page().Webtable(properties,"rows:=rowNum","cols:=2").Click

Then I used SendKeys methed and Set, none of them work.
I tried with setting the innertext directly too as:

Code:
AttributeObject.Object.innertext="Value"

Even I tried with SetROProperty method too.

Please suggest me some solution.

Thanks,
Pooja
Reply
#5
Solved: 8 Years, 5 Months ago
I think you are trying to select check boxes in the webtable by the row and column numbers. Please try below code:

Code:
Browser("Browser").Page("Page").WebTable("Table").ChildItem(Row, Col, "WebCheckBox", 0).Click
.

This will click on the webcheckbox in a webtable cell.
If this is not your requirement, please give me steps on what you are trying to code.
Reply
#6
Solved: 8 Years, 5 Months ago
Hi,

Actually I want to select a value from the dropdown, which is a webElement.

Above mentioned code was the one of ways which I used for setting the webelement value, but it dint work.

Can you please see my 1st comment it will show you all the ways which I tried for resolving this issue.

Thanks,
Pooja
Reply
#7
Solved: 8 Years, 5 Months ago
Try this Below code, and confirm whether it worked or not?

If Web List Works Use the Below Code.
Otherwise Create a Description Object (Ex: oDesc) and use the same in place of "Weblist"

Code:
Set temptable = Browser("Browser").Page("page").WebTable("class:=X", "html tag:=TABLE")  
For r = 2 to temptable.RowCount
    For c = 2 to temptable.ColumnCount(r)      
             Set Col1 = Browser("Browser").Page("Page").WebTable("class:=griddata", "html tag:=TABLE").ChildItem(r,c,"WebList", 0)
                  Col1.Select "XXX"  or DataTable.Value("WarrAMC", DtlocalSheet)
        Next
Next
Reply
#8
Solved: 8 Years, 5 Months ago
Try this Below code, and confirm whether it worked or not?

If Web List Works Use the Below Code.
Otherwise Create a Description Object (Ex: oDesc) and use the same in place of "Weblist"

Code:
Code:
Set temptable = Browser("Browser").Page("page").WebTable("class:=X", "html tag:=TABLE")  
For r = 2 to temptable.RowCount
    For c = 2 to temptable.ColumnCount(r)      
             Set Col1 = Browser("Browser").Page("Page").WebTable("class:=X", "html tag:=TABLE").ChildItem(r,c,"WebList", 0)
                  Col1.Select "XXX"  or DataTable.Value("xxxx", DtlocalSheet)
        Next
Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 4,564 10-01-2019, 10:44 AM
Last Post: shilpi952
  unable to rowcount in web table manoj84monu 1 2,928 06-13-2016, 04:46 PM
Last Post: Anu1234
  Fetching total number of records inside a webtable vidya2k2 2 3,960 06-15-2015, 02:55 PM
Last Post: venkatesh9032
  GetRows() not fetching the exact record from the recordset Saranyaciet2 0 2,822 05-27-2015, 11:15 AM
Last Post: Saranyaciet2
  table output values shipu 1 2,350 01-24-2014, 10:06 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 5 Guest(s)