Finding Element highlighted Yellow and click associated check box

I am working on building a bot that navigates to a website, takes in user input, in the form of an interger, than types that variable into a search box and looks for the text on the website that is highlighted “yellow” . I identified the html where it reflects the text is highlighted “Yellow” ,but i cant get the bot to find it. I tried incorporating an if/then statement, but i am not having any luck. Any assistance would be greatly appreciated. Main.xaml (39.9 KB) project.json (954 Bytes)

Hi,

Can you try the following? I just modified some selectors etc.

Main.zip (5.0 KB)

Regards,

thank you Yoichi. How would i click the box next to the section that was highlighted in yellow?
Would you use the click action and anchor it to the location of the highlighted box ?

@jason.brown I think you first need to find an element from webpage.
You can use Inject JScript activity to get the selector of yellow highlighted element then perform click activity on the selector

Hi,

Hope the following helps you.

MainV2.zip (5.4 KB)

I added Click activity which clicks a checkbox beside NAIC_Code.

Regards,

In case of CSS Properties are to read out for further support following component is available for this task:

thank you Yoichi. When i used your code and had the out print out to a message box , the message box is returning blank. The reason why i am looking to see if anything is returned is because i am trying to implement an If/then , where if the NAIC code, which would be highlighted “Yellow” is not present on the screen, then it should click down on the page, via hot key, and look for the NAIC code on the page again. I have tried this multiple ways , but nothing is working and the “Get Attributes” , visible AANAME={{NAIC_CODE}} does not return the NAIC Code that i entered in initially at the prompt.

Hi,

I think perhaps you should have user select valid number only.

I modified your sample as the following. Can you try this?

MainV3.zip (18.6 KB)

Regards,

Yoichi , l implemented your code and WOW it worked like a charm . So i want to make sure i understand what you did. You extracted the data structure of the NAIC codes into an array. Then you reused the user prompt i initially established and created a drop down box with the datatable variable piped into the “options” .

Can you explain the formula you entered in the “arrCode” variable .

1 Like

Hi,

arrCode = ExtractDataTable.AsEnumerable().Select(function(r) r("NAICS_Code").ToString+"_"+r("Industry").toString).ToArray

This expression is LINQ. Select method returns collection which iterate rows of datatable extracted from checkbox area, and its item is NAICS_CODE +“_” + Industry names in each row.

Regards,

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