cancel
Showing results for 
Search instead for 
Did you mean: 

Get to a table ROW in Chrome

Super Contributor

Get to a table ROW in Chrome

So I have some tests. Like a jerk, I did not test them on Chrome. Observe the following code:

 

// This value drives the DISPLAY of a selected row and demonstrates that it is or is not selected.
// This has only been proven for activity data grid. This needs to be proved on future grids.
function IsRowSelected(row)
{
	var rowClassName = row.className;
	if (rowClassName.includes("row-selected"))	
	{
		return true;
	}
	return false;
}

// Select desired cell. If not already selected, click it. (If
// it is already selected do not click as clicking will de-select.)
function SelectCell(table, rowIndex, colIndex)
{
	
	var row = table.Row(rowIndex);
	if (!IsRowSelected(row))
	{
	  	table.Cell(rowIndex, colIndex).scrollIntoView();
		aqUtils.Delay(ProjectSuite.Variables.TinyWaitTimeout); /// inconsistent error on click 
		table.Cell(rowIndex, colIndex).Click();
	}
}

Chrome does not expose a Row object. 

This works in Edge and IE. I have not tested Firefox yet, but it is next on my list.

Being able to access the Row by index is pretty cool. Is this just not accessible for certain browsers? 

Thanks

 

4 REPLIES 4
Community Hero

Re: Get to a table ROW in Chrome

Hi,

 

It is quite possible that some different markup without <tr> elements is provided for the Chrome browser.

I would recommend to examine page structure displayed in Chrome using Object Browser and find out how exactly this given table is marked-up.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Super Contributor

Re: Get to a table ROW in Chrome

There are definitely <tr> tags. 

Community Hero

Re: Get to a table ROW in Chrome

Check if Rows collection is provided in the Object Browser. If it is, then you should be able to access rows using syntax like this:

table.Rows.Item(i);

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Super Contributor

Re: Get to a table ROW in Chrome

It is available in the object browser for IE and Edge, not Chrome. 

New Here?
Join us and watch the welcome video:
API Testing Mistake #2
APITestingMistake#2
Top Kudoed Authors