How to click on text left of a relative text

Dear all,

I tried to face my problem with anchors and different others ways but I could not solve it. Now it is your turn:

I have a table in a browser with 6 columns (actually much more but that doesn’t matter) and a lot of lines. I would like search for the relative job number (in this case 11111101 as top number but the number and position could change) and than left click on the time which is 6 columns left of the job number (in this case 16:00, but it could also be e.g. 14:00).

Any idea? Thank you very much for your help.

@on_and_on

You can use something liek this…for this you need to use ui explorer and then find the selector which looks like the below…center top and left top menu can be used for that(last 3 lines are important for you to identify uniquely

<webctrl title.. />
<webctrl tag=‘Table’ />
<webctrl tag=‘TR’ innertext=‘*{{variablecontainingid}}*’ />
<webctrl tag=‘TD’ tablecol=‘1’ />
<webctrl tag=‘A’ innertext=‘*:*’ />

Cheers

Dear @Anil_G, thank you very much for you reply. I tried a lot during the last days with the UI Explorer but if I try you set the element and anchor the result looks this way:

<html app='firefox.exe' title='Operations Log' />
<webctrl class='olGrid' parentid='aspnetForm' tag='TABLE' />
<webctrl aaname='11138544' tableRow='5' tag='A' />
<nav up='2' />
<webctrl aaname='THU 22:00(f)' tableRow='5' tag='A' />

Can you provide a bit more details how to find the right selector and how to identify the job number and time?

Thanks a lot.

Use Get Attribute to find the tableRow value for the 111111101 element, then use that value in the selector for the 16:00 element. The other attributes for the click selector should be generic to the point where they would match any of the elements in that column.

Hi @on_and_on ,

Maybe a modification on the selector would be the below :

<html app='firefox.exe' title='Operations Log' />
<webctrl class='olGrid' parentid='aspnetForm' tag='TABLE' />
<webctrl aaname='{{jobNumber}}' tableCol ='8' tag='A' />
<nav up='2' />
<webctrl tableCol='1' tag='A' />

From the above Selector, assumed Table Schema starts as shown in your Screenshot, so there are 8 Columns identified (It is not accurate, but assumed as seen).

The anchor is the column 8 always and the value to be retrieved or selected is the Col 1. jobNumber is a variable which would contain the varying job Number each time and you can use it as shown in the Selector so that it acts as the anchor.

Let us know if you can find and map the attributes similar to the above shown selector and let us know if it doesn’t work.

@on_and_on

Try to find the tag TR and TD which would generally be between table and the A tag

Cheers

Dear all,

you are incredible awesome. And the UIExplorer is an outstanding tool (if know to use it).

I combined your help and now I am able to get the “tableRow” of the variable “jobnumber” within col7. Using that tableRow variable I am able to click “16:00” within col1. But afterwards I am facing a problem. The innertext of col1 is “ready 16:00” and I am not able to get only “16:00” as innertext to save it as a variable. I tried to get the whole innertext of col1 (which is ready 16:00) and split it with Split(innertextsplit," ") but the output must be a “System.String[ ]” which is not usable afterwards as a variable in the click activity. I could try to save the whole innertext of the specific col1 to an excelsheet and manipulate the text in excel but that sounds just like a workaround to me.

Any better ideas from your site? Thank you so much for your help.

@on_and_on,

It seems that the initial Issue on Clicking the Time has been resolved as you have stated, but now you would also want to extract the Time value ?

We would also like to know what specifics have you combined, so that we can move towards providing the suggestion/approaches towards it.

Not so sure, if this is done to Perform the Click on the Time element but the Output of Split is an Array and we can use the below Expression to get the Last Element to a variable of Type or you could just use the expression if there is no further use of the value :

timeValue = Split(innertextsplit," ").Last

Dear all, after a lot of reading, watching youtube tutorials and testing I figured out this solution.

First of all I had to use only strict selectors!!!

  1. I get the tablerow of the jobnumber by
    <webctrl aaname='{{jobnumer}}' tag='A' tableCol='7' />
    and saved it as “jobnumberrow”

  2. I could just click on the time (second element of col1) with:
    <webctrl tableRow='{{jobnumberrow}}' tag='A' tableCol='1' idx='2' />

I am not sure how I found it out but idx=‘2’ is essential but if I search for the element by the UI-Explorer the selector idx=2 did not appear anywhere.

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