Jump to content

How to script click button in chrome

Recommended Posts

Hello. I am a new to AutoIt world and I would appreciate if you could help me in the following two problems:

1) How to call button clicking in chrome. I have inspected the element and it was:

<button class="icon icon-pane" data-ignore-capture="any" title="New pane" data-reactid=".0.1:$main.3.0:$PaneHeader.1.$panelist-header.0.$=11.0">New pane</button>

2) how to script a selection of an item from a list in column A in excel and loop through up until it finishes the whole list. 

<span class="emojitext ellipsify" dir="auto" title="item taken from excel Col1" data-reactid=".0.1:$main.2.0.$=10.0.$=$"item taken from excel Col2"@c=1us.$"item taken from excel Col2"@c=1us.">item taken from excel Col1</span>

kindly note that I have already installed chrome.au3 and so the script should work in chrome environment.

I would appreciate your help

thanks in advance

Link to post
Share on other sites

I tried to manipulate the code to get the button clicked but no success. Can you help me?

#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP7=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=EasyGame Web - Mozilla Firefox;controltype:=UIA_WindowControlTypeId;class:=MozillaWindowClass", $treescope_children)  
Local $oP6=_UIA_getObjectByFindAll($oP7, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children)   
Local $oP5=_UIA_getObjectByFindAll($oP6, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children)   
Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children)   
Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=EasyGame Web;controltype:=UIA_DocumentControlTypeId;class:=", $treescope_children) 
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children)   
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children)   
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children)   
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll("Newpane.mainwindow", "title:=New pane;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=New pane;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...