cancel
Showing results for 
Search instead for 
Did you mean: 

click action in navigate doesn't work

juiyulin1
Level 3
Hi
I'm new for Blue Prism.
I got a problem when tried to change absolute time range on Grafana page by BP.
The date can be changed but when I tried to click "Apply time range", it didn't work.
No error happened, I think it might have the action, but the time range just not be applied.
Is there other way that can make it work or can alternate click action?
Thanks
37096.png37097.png
1 BEST ANSWER

Helpful Answers

Hi Jui,

I think it might be happening due to different versions of Blue Prism Interactive Client. Can you tell me which version you're currently using?

For the time being, I will post screenshots which can help you. Below as you see is the workflow for JS execution where I have created a custom business object to search for a text on Google.

37091.png

Going inside this business object now, you can see I have two data items created called, Insert JS Fragment and Invoke JS Fragment.

The Insert JS Fragment has a function definition mentioned which looks for an HTML element with the name attribute as "q" which is the search textbox in google and then writes the value which I am passing through it. Once the value has been written, the code looks for the name attribute as "btnK" which is the search button.

The function is as follows:

function writeText(searchText){
                    document.getElementsByName("q")[0].value = searchText;
                    document.getElementsByName("btnK")[0].click();
}

The Invoke JS Fragment is calling that function while passing the value as well which in my case is : writeText("Blue Prism")

Now in order to execute both these functions one by one I have used one Navigate Stage and have used the action "Insert Javascript Fragment" twice. The first time I am inserting the "Insert JS Fragment" data item and the next time I and again using the same action for inserting the "Invoke JS Fragment" data item.

37093.png
37095.png

In your case also the actions will be similar, the only thing that will change is the JavaScript code where you can use getElementById if you have the ID attribute for that "Apply Time Range" button and you just need to use the click() function and not write anything. Also, no input parameter would be required to be sent out so your Invoke JS Fragment data item would also be something simple like: function_name()  which in my case was writeText("Blue Prism")
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

View answer in original post

4 REPLIES 4

Hi Jui,

You can try to invoke Javascript to this page and by using the document.getElementById(<Object_Id>).click() and see if that works. I am attaching a sample workflow for the same which can give you some idea.

Supply the Object_ID text in the query above.

Hope it resolves your query and if it does, please mark the answer as the 'Best Answer' so that others facing similar doubts can track the answer easily.
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

juiyulin1
Level 3
Hello @Devneet Mohanty
Thanks for providing the idea, I will try it later.
However I can't open the BPRELEASE file that you attached.
It show this error :
" An error occurred while attempting to import the release:
AMI did not recognise the action type 'WebIsConnected' "

Hi Jui,

I think it might be happening due to different versions of Blue Prism Interactive Client. Can you tell me which version you're currently using?

For the time being, I will post screenshots which can help you. Below as you see is the workflow for JS execution where I have created a custom business object to search for a text on Google.

37091.png

Going inside this business object now, you can see I have two data items created called, Insert JS Fragment and Invoke JS Fragment.

The Insert JS Fragment has a function definition mentioned which looks for an HTML element with the name attribute as "q" which is the search textbox in google and then writes the value which I am passing through it. Once the value has been written, the code looks for the name attribute as "btnK" which is the search button.

The function is as follows:

function writeText(searchText){
                    document.getElementsByName("q")[0].value = searchText;
                    document.getElementsByName("btnK")[0].click();
}

The Invoke JS Fragment is calling that function while passing the value as well which in my case is : writeText("Blue Prism")

Now in order to execute both these functions one by one I have used one Navigate Stage and have used the action "Insert Javascript Fragment" twice. The first time I am inserting the "Insert JS Fragment" data item and the next time I and again using the same action for inserting the "Invoke JS Fragment" data item.

37093.png
37095.png

In your case also the actions will be similar, the only thing that will change is the JavaScript code where you can use getElementById if you have the ID attribute for that "Apply Time Range" button and you just need to use the click() function and not write anything. Also, no input parameter would be required to be sent out so your Invoke JS Fragment data item would also be something simple like: function_name()  which in my case was writeText("Blue Prism")
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Hi @devneetmohanty07 

Similarly I am facing an issue, using click in navigate I am not able to perform right click operation in a webpage using HTML spied element.

In the HTML element in match attributes it only checked with xpath/webpath.

 

Is there any way to perform right click using xpath invoking javascript?