cancel
Showing results for 
Search instead for 
Did you mean: 

Get to a table ROW in Chrome

SOLVED
Highlighted
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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: Get to a table ROW in Chrome

Hi All,

As far as I understand this question is related to this one. Let's keep the conversation there.

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

6 REPLIES 6
Highlighted
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 Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Super Contributor

Re: Get to a table ROW in Chrome

There are definitely <tr> tags. 

Highlighted
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 Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Super Contributor

Re: Get to a table ROW in Chrome

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

Highlighted
Super Contributor

Re: Get to a table ROW in Chrome

I am having the same issue. Normally I would not care. But the TR has something in the class attribute I need. ANyone have anything if I BUMP this?

Highlighted
Community Manager

Re: Get to a table ROW in Chrome

Hi All,

As far as I understand this question is related to this one. Let's keep the conversation there.

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
A new challenge is here!

Create a function to drag one element to another for the TechCorner tag!

Will you dare to take the challenge?


Scripts created in July:
- Passing custom command-line arguments as a test parameter
Top Kudoed Authors