6 posts in this topic
I have tried by class, text, etc
Here was my last attempt
$oButtons = _IETagNameAllGetCollection($o_IE, "button") For $oButton in $oButtons If String($oButton.value) = "Sign In" Then Sleep (1000) _IEAction($oButton, "click") ExitLoop EndIf Next This did not work either.
Go create a quick account in Zapier and go to https://zapier.com/app/dashboard and make some Zaps!
Just need to click the specific instance of an .open-menu button and then click its a.run (anchor) element.
Doing this IE.au3 script just causing to click its container element:
$target = 1; Target the first instance #include <IE.au3> $oIE = _IEAttach("Dashboard - Zapier") $count = 0; $tags = _IETagNameGetCollection($oIE, "div") For $tag in $tags $class_value = $tag.GetAttribute("class") If $class_value = "open-menu" Then $count += 1 if $count = $target Then MsgBox(0, "Instance: ", $count) ; $tag.fireEvent("onmousedown") ; _IEAction($tag, "click") ; $tag.fireEvent("onmouseup") ; Or this but not working ; $tag.Click EndIf EndIf Next I also tried to do it using FF.au3
$target = 1; Target the first instance #Include <Array.au3> #Include <FF.au3> $count = 0; If _FFConnect(Default, Default, 3000) Then $aArray = _FFXPath( "//div[@class='open-menu']", "", 7 ) ; _ArrayDisplay($aArray) For $tag in $aArray $count += 1 if $count = $target Then MsgBox(0, "Instance: ", $count) _FFClick($tag) EndIf Next EndIf Error: _FFClick ==> No match: $sElement: [number]
Could some help me how to click such buttons on such kind of a dynamic page?
I'm developing again (everybody ruuun! )
I would like to develope a script that goes through basicly every user control on a window, and log things that happens, and maybe do some screenshots. I did something like this before.
My problem, which I would like to avoid this time (to improve my understanding and skill) , was that when I was unable to get a ControlID or handler or anything, I simply did some math and clicked on the coordinates it should have been (for example, maxing the window, and knowing the initial set up I was ablo to calculate given control position). I know that this is a bad solution for a number of reasons.
Now I got authorization to install autoIT here, and i started to the work, AU3Info was unable to find anything on the window (this could be a problem, since autoIT doesn't see anything on it then, if I understood the help file) So I got the SimpleSpy script (source:
I added a bit of code to the original to display ID as well, what I received is this:
Mouse position is retrieved 115-207
At least we have an element title: [ADD] class: [Button] ID:  (<-- coded this to display ID here as well)
Having the following values for all properties:
Title is: <ADD> Class := <Button> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) 10;187;120;35
*** Parent Information top down ***
3: Title is: <Compass> Class := <Window> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) -8;-8;1936;1056
2: Title is: <> Class := <MainView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;23;1920;1017
1: Title is: <> Class := <TileNavigationView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;23;1920;967
0: Title is: <> Class := <AreasView> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 0;132;1920;858
so far I wrote this script:
WinActivate('Test') ;It works!! :D first official interaction Sleep(1000) ;1 sec sleep to be sure ControlClick('Test', '', '50000') If @error Then MsgBox($MB_SYSTEMMODAL, 'Error', 'ControlClick error') EndIf Sleep(1000) MsgBox(1,"Tracer message", 'ControlClick has happened') ;MouseClick() ;ControlCommand() AutoIt activates the window, but the click on the given button doesnt happen (I tried to write 50000 without ' ' on ID).
M'I doing the @error part correctly ? (no error Msg has been displayed), sorry I rarely use AutoIT and seems to forget less and less after each neglect, but still I'm far from a proffessional
Any help or suggestion is welcome, thank you for your time and insight!
Basically I'm trying to figure out what would be the most efficient means of making multiple use buttons. What I'd like is to be able to click a button and pop up a msgbox to gather some info, or two message boxes, but upon entering that info and the msgbox dialogue being over, it'll then switch to a different function. I was thinking of using 1/0 to designate which is true or not, but not sure if that'd be the most efficient way. Still very new to coding, and autoit, any help would be great!