Click on table row based on that two cells meets a condition

Hi,

I have a table(HTML) where every row(Cell) is clickable. If I click on a row I get redirected to a different webpage.

One of the column cells contains a date. I know how to pass a variable to an “aaname”:
image

My click activity now clicks on the row of the table where the cell value and aaname='{{dateA}}'

My question is how can I make the click activity click on a row where the two cell values on the same row needs to meet a condition. The problem is that the same date can appear two times in the table and because of that I need it to check with one more cell.

1 Like

Thanks for your post - @atomic

You can achieve the same using various approaches, Here is the few…

  1. Instead of going with table cell (TD), go with (TR) and its aaname should have two dates with wildcard -> dateAdateB*
  2. Else Get Text from both table cells which has the date, If your dates satisfy the condition then click on the intended row - Getting row index from the previous.

Hope this helps.

Thanks :slight_smile:

1 Like

Hi thanks for your reply.

I am not really getting the first explanation. Currently im using A click activity where the aaname needs to be the same as the variable that contains a specific value.

Which activites do I need to use to achieve the things you describe?

Do you mean that I should extract the whole table and use a for each row and when the two cells meets the condition click it?

1 Like

@atomic, First explanation is

While you indicate element using click activity, try choosing the entire row and use the aaname as mentioned.

Dont indicate the table cell.

Thanks :slight_smile:

Okay, I cant highlight just the row. It just highlights the cells and the entire datatable.

Is there a way to edit inside the Ui Explorer to make it highlight the entire row?

1 Like

Yes @atomic, You need to use visual tree window in UiExplorer.

Thanks :slight_smile:

Hi, I managed to do it by selecting this:

I dont have a aaname to manipulate only this ones:

The cell values are stored inside of “innertext” and they are not separated by “,” just spaces(" ").

1 Like

That doesnt matter, those are the cell values collectively without formatting.

So just use aaname = (star)dateA(start)dateB(star).

This should resolve the issue.

Thanks :slight_smile:

1 Like

Thank you it works great.

Just one thing. Does it matter where in the innertext the variables are placed?

It looks something like this, I have changed the innertext data but the format and order is the same.

<webctrl id='rad0' name='rad0' parentid='sorttab' parentname='sorttab' tableCol='1' tableRow='2' tag='TR' innertext='RandomText 123123 2021-01-04 FL TextText 5.3200XXXXX xxxxx zzzzz zzzzzz 1 123122015-02-04 LAL 4365242 Yes' />

Just to clarify:

  1. “5.3200XXXXX xxxxx” should be two cells. “5.3200” is separate cell from “XXXXX xxxxx”
  2. “zzzzz zzzzzz 1” is one cell
  3. “123122015-02-04” should be two cells. “12312” is a separate cell from “2015-02-04” is one cell.

So a total of 16 columns where some cells are empty.

1 Like

I have a problems where the cell in the innertext doesnt have “spaces between” each other.

I have tried something like this: *{{test1}}{{test2}}*{{test3}}{{test4}}*{{test5}}*

Like between {{test3}}{{test4}} there is no space in the innertext but it doesnt work.

1 Like

@atomic, Great :slight_smile:

Yes the variable position matters if you are using the entire value.

I suggest replace those unused field values with wildcard -> *

Thanks :slight_smile:

Cool :slight_smile:

<webctrl id='rad0' name='rad0' parentid='sorttab' parentname='sorttab' tableCol='1' tableRow='2' tag='TR' innertext='RandomText 123123 2021-01-04 FL TextText 5.3200XXXXX xxxxx zzzzz zzzzzz 1 123122015-02-04 LAL 4365242 Yes' />

Just to clarify:

  1. “5.3200XXXXX xxxxx” should be two cells. “5.3200” is a separate cell from “XXXXX xxxxx”
  2. “zzzzz zzzzzz 1” is one cell
  3. “123122015-02-04” should be two cells. “12312” is a separate cell from “2015-02-04” is one cell.

So a total of 16 columns where some cells are empty.

I will use the above as an example. Lets say i want to replace “5.3200XXXXX xxxxx” for variable.
Note that “5.3200XXXXX xxxxx” is two cells as stated above.

I also want to replace “123122015-02-04” for a variable. Note that “123122015-02-04” is two cells as stated above.

How would I write it in the format *{{test1}}{{test2}}*{{test3}}... ?
Note that I dont care about the values in the other cells/innertext.

1 Like

@Nithinkrishna Do you know what I mean ? :slight_smile:

1 Like

@atomic, Got your point. You can do the same.

The order matters. Add wildcards on both ends of each field.

Wildcard - anything may or maynot come in between.

Thanks :slight_smile:

1 Like

Yes, The first thing i tried was this:

*{{test1}}*{{test2}}*{{test3}}*{{test4}}*{{test5}}*

The problem is that some innertext values doesnt have “spaces(” ") in between eachother. I tried to remove a wildcard between {{test3}}*{{test4}} —> {{test3}}{{test4}} to simulate how it is in the innertext. But still, it does not work.

And yes I have the order in mind.

1 Like

Even though there is no space, using wildcard doesn’t cause any issue.

It’s just a preventive measure like covering both cases.

Thanks :slight_smile:

I have tried to make it work but it still does not work. I will try more tomorrow :slight_smile:

If you have an solution with the example above you can maybe write it down?

Thinking about this one:

<webctrl id='rad0' name='rad0' parentid='sorttab' parentname='sorttab' tableCol='1' tableRow='2' tag='TR' innertext='RandomText 123123 2021-01-04 FL TextText 5.3200XXXXX xxxxx zzzzz zzzzzz 1 123122015-02-04 LAL 4365242 Yes' />

Just to clarify:

  1. “5.3200XXXXX xxxxx” should be two cells. “5.3200” is a separate cell from “XXXXX xxxxx”
  2. “zzzzz zzzzzz 1” is one cell
  3. “123122015-02-04” should be two cells. “12312” is a separate cell from “2015-02-04” is one cell.

So a total of 16 columns where some cells are empty.

I will use the above as an example. Lets say i want to replace “5.3200XXXXX xxxxx” for variable.
Note that “5.3200XXXXX xxxxx” is two cells as stated above.

I also want to replace “123122015-02-04” for a variable. Note that “123122015-02-04” is two cells as stated above.

How would I write it in the format *{{test1}}{{test2}}*{{test3}}... ?
Note that I dont care about the values in the other cells/innertext.

How would you do it? :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.