Autoclick a button

Greetings, i would like to auto-click a button when the page loaded.
I have a file uploader button, im accessing this webapp via iOS, so it popups 2 options (camera, and photos folder).

I tried theese:

  • js=“var x=document.getElementsByClassName(”“Button1"”);for(var i=0; i<x.length; i++){ x[i].click();}" ExecuteJavaScript js
  • js=“document.getElementById(’”+Button1.ControlID+"’).click();" ExecuteJavaScript js
  • js=“function eventFire(el, etype){if (el.fireEvent) {el.fireEvent(‘on’ + etype);} else {var evObj = document.createEvent(‘Events’);evObj.initEvent(etype, true, false);el.dispatchEvent(evObj);}} eventFire(document.getElementById(’”+Button1.ControlID+"’), ‘click’);" ExecuteJavaScript js

none of them fires

Browsers don’t allow that. The problem is that you’d effectively be able to upload a file that a user hadn’t intended to give you, so the browsers require a physical click for this.

Thank you for the quick answer.