Forum Discussion
5 Replies
- Marsha_R
Champion Level 3
Did you check the sections at the bottom of that page? They all have examples of code to do different things.
- anuragrblOccasional Contributor
I checked but i haven't seen any method related to fetch column index.
- Marsha_R
Champion Level 3
Can you use Object Spy on one of the cells and let us see the properties?
- rraghvani
Champion Level 3
Can you provide a screenshot of the Object Spy tool, with the properties of your grid control?
- Hassan_Ballan
Champion Level 1
In concept web page table should not be too different from Windows forms table, and following this example you should be able to manipulate it. You only need to figure out your available similar properties for ColumnIndex and RowIndex.
Access https://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_intro
On Project level variables add the following string variables:
ColumnName
ColumnIndex
RowIndexIn NameMapping map the following nodes under NameMapping.Sys.browser.pageW3schoolsTryitEditor.frameIframeresult
column with XPath=//th[.='%ColumnName%']
row with XPath=//tr[%RowIndex%]/td[%ColumnIndex%]Now you can test it with this code, modify the ColumnName and RowIndex to your choosing
def Test1(): Var1 = 0 Browsers.Item[btChrome].Run("https://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_intro") Aliases.browser.pageW3schoolsTryitEditor.Wait() Aliases.browser.pageW3schoolsTryitEditor.frameIframeresult.RefreshMappingInfo() Project.Variables.ColumnName = "Contact" Project.Variables.RowIndex = "3" Var1 = Aliases.browser.pageW3schoolsTryitEditor.frameIframeresult.column.ColumnIndex Project.Variables.ColumnIndex = Var1 + 1 Log.Message(Aliases.browser.pageW3schoolsTryitEditor.frameIframeresult.row.contentText, "")
P.S. if you like my post give a like, and if it solved your problem mark it as solution to give credit.