Imacros click selector - imacros

I'm a beginner in imacros.
FRAME F=1
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV:nth-of-type(5)>SPAN" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>SPAN" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV:nth-of-type(6)>SPAN" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV:nth-of-type(3)>SPAN" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV:nth-of-type(4)>SPAN" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>SPAN" BUTTON=0
I have them all in 6 different saved macros with the frame f=1, is there a simpler way to make it click all of them from just 1 saved macros command instead of 6?, it be much easier if I can make it click with just one command ...like one command would work to click any of the 6 random ones? maybe I need to shorten one of them and it would work to click any of them?
and it's to make it click as fast as it goes so putting all 6 click commands into one will run but it'll click slower do to clicking the right one all the time, just wondering if i can put just one command would make it click regardless which 6 command it is.

Try this macro having only one line:
URL GOTO=javascript:{for(i=1;i<=6;i++)window.frames[0].document.querySelector("HTML>BODY>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV:nth-of-type("+i+")>SPAN").click();}
('iMacros for Firefox' v.8.9.7)

Related

Single log generation for single click and double click c++

I have an application to log mouse clicks. I need a single log for each clicks. During double click, the mouse button generates a sequence of messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBCLK and WM_LBUTTONUP. So I am getting 4 logs for each double click. Since logs are handled with generating messages.
Is there any way to restrict the other logs and get the log of WM_LBUTTONDBCLK only.
Thanks in advance.
As you know, the Windows can't detect "double click" from first pressing. So, you should do this himself.
For example, at first single click you start timer (for example, upto 500 ms). In case the timer is over and double click hasn't been received you log single click. In other case you should log double click.

iMacros Script Form Filing not working with Event or Content Method

I am trying to fill up a form for the URL https://kite.zerodha.com
I tried filling up the form using xpath and event method, however both seems not to be working.
TAG XPATH="//input[#type='text']" CONTENT=ABCDEF
The other known method is Event using keypress, however that also seems not be working
EVENT TYPE=KEYPRESS XPATH="//input[#type='text'] CHAR="ABCDEF"
I also tried to tried to use button click to highlight the cell, however nothing happens. Was wondering that is there any other way to make it work.
EVENT TYPE=MOUSEDOWN XPATH="//input[#type='text']" BUTTON=0
If you recorded the macro in Experimental event recording mode, you would get something like this:
EVENT TYPE=CLICK SELECTOR="#container>DIV>DIV>DIV>FORM>DIV:nth-of-type(2)>INPUT" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#container>DIV>DIV>DIV>FORM>DIV:nth-of-type(2)>INPUT" CHARS="ABCDEF"

Text input fields in iMacros

I want to fill out a text field in an AJAX form.
The AJAX nature of the form prevents me from doing something like this...
TAG TYPE=INPUT:TEXT FORM=Listing ATTR=NAME:Name CONTENT={{!COL1}}
Instead, in order to position the cursor in the field itself, I am needing to do something like the following...
CLICK X=411 Y=434
Also, I'm using the Firefox version so Direct Screen doesn't work because DS is only supported in Explorer. For example,
DS CMD=CLICK X=411 Y=434
doesn't work. If it did, then I would try something like:
DS CMD=CLICK X=411 Y=434 CONTENT={{!COL1}}
But, as mentioned, DS doesn't work in Firefox.
I need to emulate the action of actually typing the keys on the keyboard.
So how would I do this and actually insert data into the field?
I solved this (and an associated dialog handler issue) by using the EVENT recording mode.
Procedure:
Open #Current.iim
Rec
Record options
Experimental event recording mode (select this radio button option from popup/dialog menu)
The resulting code was as follows:
#Current.iim
VERSION BUILD=8970419 RECORDER=FX
TAB T=1
URL GOTO=https://console.developers.google.com/project
EVENT TYPE=CLICK SELECTOR="#projects-create" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#p6n-project-name-text" CHARS="My Project"
EVENT TYPE=CLICK SELECTOR="#p6n-project-creation-dialog-ok-button>BUTTON" BUTTON=0

Wait cursor not getting dislpalyed in mfc?

I need a wait cursor to be loaded when the second page OnWizardNext of a property sheet is clicked .This is how I had done.Actually I designed a property sheet and now when I Click on the Next button I had activated the hourglass ,till this point everything works fine ,here arises the actual problem i.e,during that wait cursor period if I click again on Next button the dialog is getting dismissed .So,my intention is even if I click Next during the wait cursor it should not react to the click event.
LResult OnWizardNext()
{
CWaitCursor wait_cursor();
Sleep(10000);
return CPropertyPage::OnWizardNext()
}
if I remove Sleep then no wait cursor is getting loaded.What I need is even though if click on any button anything the event for that button should not get triggered until unless i am out of sleep time.
Can anyone please let me know how to achieve this.
I think you have a problem with the design of your wizard. You should not be using "Sleep" as it will suspend the thread. Moreover, the wait cursor is nothing more than a UI mechanism to indicate to the user that the code is still active. You seem to want to use that as a determinant for when your code can continue. Take a look at using OnSetCursor to provide visual feedback. Depending on what it is you're waiting on, you may want to look at using a timer, or, perhaps a series of "flags" to indicate a "continue" condition.

ZK how to remove waiting actions

I have an textbox with onChange method and button to make some actions. But if I type some thing in textbox and not clicking any where , click that button, It calls onClick method and then onChange method.Or first onChange and then OnClick but I should disable all actions after that onChange method.
Add the check to your onClick() method. The onChange() for a text box is fired after a certain period of time or after you deselect your component. If you deselect your component by clicking on a button it sounds pretty natural to me to get the onClik first and then the onChange. There is no way of controlling (as far as I know) these events, except on server side.
Read this !
Keep in mind that you are developing a WEB application and not a Desktop Application. And event if the development of zk applications may look pretty similar to the desktop applications they are not and they have their limitations.
I found solution :
First for Textbox onFocus method I disable next button , and user cant click it.
Second for Textbox onBlure method I enable next button. (To be fired onBlure action user should click somewhere on window or press tab and this fires onChange action)