i have to click on button using js ,unable to do it

15 views Asked by At
body > div.ms-Layer.ms-Layer--fixed.root-213.fui-FluentProvider1 > div > div > div > div > div > div.progressList_4e66cf7f > div > div > div > div > div > div > div > div > div > div > div.actions_313b4a6d > div > div.ms-LayoutGroup-item.css-233 > button > span

its a button in sharepoint portal where it shows replce when we upload same file this popup will appear and i should click on this how to do it using js,or .net,c# actually im an rpa developer strugelling to get his i need to use thst code in tool called uipath

1

There are 1 answers

0
Conor On

You could solve this in a similar way to bookmarklets, where JavaScript is stored in a bookmark and executed in the current tab. I've popped a couple of options for this below, hopefully one of them will work. Essentially if you type the below into the address bar it will execute the JavaScript on the current page.

Use the element Id

javascript:document.getElementById('myButton').click();

Use the query Selector, what you have above

javascript:document.querySelector('body > div.ms-Layer.ms-Layer--fixed.root-213.fui-FluentProvider1 > div > div > div > div > div > div.progressList_4e66cf7f > div > div > div > div > div > div > div > div > div > div > div.actions_313b4a6d > div > div.ms-LayoutGroup-item.css-233 > button > span').click();

Using the class name

javascript:document.getElementsByClassName("example").click();