Recording not capturing checkbox click

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
RayB
Posts: 34
Joined: Sat Mar 28, 2015 4:19 pm

Recording not capturing checkbox click

Post by RayB » Tue Sep 29, 2020 3:40 pm

Hi,

I am running W10 with FF 81 and imacros Free

I have been away from using imacros for a little while but now have a project that imacros can help with.

Here is what I am seeing. I open a browser page of 12 photos and use a previous macro to open each picture on an individual tab. THis part works fine.

I need to change this macro so that when the picture is opened on a individual tab, I then have imacros click a checkbox next to the picture. When I use the imacros record feature to capture the checkbox clicking nothing shows up int he recording. I know imacros has been changed so some of the old features I used to use don't work. I was thinking that I could use XY coordinates but I can't seem to find this feature.

I have searched the forums but don't find anything that helps me with this current imacros version.

Anyone have an idea how to accomplish my task or can point me to the correct thread?

Thanks in advance for your help!
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Recording not capturing checkbox click

Post by chivracq » Tue Sep 29, 2020 4:25 pm

RayB wrote:
Tue Sep 29, 2020 3:40 pm
Hi,

I am running

Code: Select all

W10 with FF 81 and imacros Free
I have been away from using imacros for a little while but now have a project that imacros can help with.

Here is what I am seeing. I open a browser page of 12 photos and use a previous macro to open each picture on an individual tab. THis part works fine.

I need to change this macro so that when the picture is opened on a individual tab, I then have imacros click a checkbox next to the picture. When I use the imacros record feature to capture the checkbox clicking nothing shows up int he recording. I know imacros has been changed so some of the old features I used to use don't work. I was thinking that I could use XY coordinates but I can't seem to find this feature.

I have searched the forums but don't find anything that helps me with this current imacros version.

Anyone have an idea how to accomplish my task or can point me to the correct thread?

Thanks in advance for your help!

iMacros Version is missing from your FCI but if using FF81, then that will be v10.0.2 ('Fee') then...

And the Thread is not "really" specific to the 'iMacros for FF' Sub-Forum, but OK, "we" could argue about that...

Then well, if v10.0.2 for FF which only supports the 'TAG' Mode (+ 'POS' / 'XPATH' / 'SELECTOR'), doesn't record clicking on that CB, then hum, it's a bit "difficult" to give some if-if-if Generic Advice as you didn't post the URL.., but there are many things you can try...
- Look at the HTML Source to analyze if and how that CB is declared/constructed, and try "blind" with 'POS=1' / 'POS=2' etc, and/or with 'Relative Positioning'. (Oh...!, there is a Mistake btw "somewhere" in the Wiki, "Standard" CB's expect "YES"/"NO" for the 'CONTENT' Param...)
- CB's often react also by clicking on the associated Label.
- If that CB is a "fake" CB generated on-the-fly from JS, then again, analyze the HTML Structure or the JS Code to declare/construct it and what it expects for "Selected"/"Not Selected" Values.
- Try using the 'EVENT' Mode in some other Version than v10.0.2 for FF or some other Browser, and try reusing the recorded Path/'XPATH' with the 'TAG' Mode and the 'SELECTOR' or 'XPATH' Param (in your v10.0.2 for FF Env.).
- Switch to a different Browser than FF81 that will support the 'EVENT' Mode.
- Search "our" Forum or 'SOF' ('Stackoverflow' Forum) for some Syntax to access/manipulate CB's from JS, that you will then be able to use with the 'URL GOTO=javascript' Syntax. Same if the CB is on-the-fly generated from JS, there will be some Syntax to access/control it from JS.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
RayB
Posts: 34
Joined: Sat Mar 28, 2015 4:19 pm

Re: Recording not capturing checkbox click

Post by RayB » Tue Sep 29, 2020 10:41 pm

Hi chivracq,

Thanks for getting back to me. I am running imacros 10021450.

I used FF inspector and when I selected the text I would click inspector showed the following:

<a title="Admin Options"
href="javascript:sendInfoReq('photoadmin','141594');">Move/Delete,</a>
<br>

I presume that is what you called generated on the fly, but maybe I am wrong.

So that that furthur information how would you use imacros to click this text?

Thanks in advance for your help,
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Recording not capturing checkbox click

Post by chivracq » Wed Sep 30, 2020 11:07 am

RayB wrote:
Tue Sep 29, 2020 10:41 pm
Hi chivracq,

Thanks for getting back to me. I am running

Code: Select all

imacros 10021450.
I used FF inspector and when I selected the text I would click inspector showed the following:

Code: Select all

 <a title="Admin Options"
href="javascript:sendInfoReq('photoadmin','141594');">Move/Delete,</a>
<br>
I presume that is what you called generated on the fly, but maybe I am wrong.

So that that furthur information how would you use imacros to click this text?

Thanks in advance for your help,

Well, not much I can add to my previous Reply, but nope the mini-Source Excerpt you posted looks like a "fairly Standard" (Action) Link/Button, yep, possibly handling the Action related to selecting the CB for that Item that might be identified by "141594".
Then, well, simply put that 'href' Action in 'URL GOTO' and see if it does what you expect...:

Code: Select all

URL GOTO=javascript:sendInfoReq('photoadmin','141594');
(Not sure if the ';' at the end is needed...)

But tja, even if it works on that specific Page for that specific Item/Photo, you'll then have for other Items/Photos to dynamically retrieve the next Value instead of "141594" that will be different each time I reckon, to pass it in a Var to the 'URL GOTO'... Can be done, that ID is very certainly available "somewhere" in the Source, but that will be a bit cumbersome... :|
Hum, yeah by simply doing an 'EXTRACT=HTM' or directly 'EXTRACT=HREF' on that Link, with stg like...:

Code: Select all

TAG POS=1 TYPE=A ATTR=TXT:Move/Delete* EXTRACT=HREF
SET Photo_ID EVAL("var s='{{!EXTRACT}'; var x,y,z; [... etc to isolate "141594"...]; z;")
URL GOTO=javascript:sendInfoReq('photoadmin','{{Photo_ID}}');
You'll need to try/test what works or not, I cant do it for you from the scarce Info you've provided about this Site/Page... :|
And I find it a bit cumbersome anyway, you didn't try anything I mentioned about the 'EVENT' Mode, I would use the 'EVENT' Mode myself...

EDIT:
Oh...!, am I stupid...!?, ah-ah...! :oops:
If that Technique works, then there is a much easier Implementation, ah-ah...!, without even needing the 'EVAL()'...:

Code: Select all

TAG POS=1 TYPE=A ATTR=TXT:Move/Delete* EXTRACT=HREF
URL GOTO={{!EXTRACT}}
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
RayB
Posts: 34
Joined: Sat Mar 28, 2015 4:19 pm

Re: Recording not capturing checkbox click

Post by RayB » Wed Sep 30, 2020 7:08 pm

Hi chivracq,

I can see I am getting closer with your help. I modifies the code shown below to include your advice:

VERSION BUILD=10021450
SET !ENCRYPTION NO
SET !EXTRACT_TEST_POPUP NO
SET !TIMEOUT_PAGE 900
' next line is for New Tab number
SET !VAR2 {{!LOOP}}
ADD !VAR2 1
SET !VAR3 {{!URLCURRENT}}
TAB T={{!LOOP}}
URL GOTO={{!VAR3}}
' next line tags the pic at !LOOP location
TAG POS={{!LOOP}} TYPE=IMG ATTR=ALT:*&&SRC:http://www.*******.net/gallery/data/*/thumbs/*&&TITLE:*&&CLASS:imgborder
' next line opens the taggeg pic for deletion
TAG POS=1 TYPE=A ATTR=TXT:Move/Delete* EXTRACT=HREF
PROMPT {{!EXTRACT}}
URL GOTO={{!EXTRACT}}
WAIT SECONDS=0.1
URL GOTO=javascript:window.scrollBy(0,420)
TAB OPEN
TAB T={{!VAR2}}
URL GOTO={{!VAR3}}

I used the PROMPT to see what was being extracted and it matched what inspector showed so it will change for each picture on the page. I run the macro using Play Loop set to the number of pictures on a page. But when the macro gets to the URL GOTO={{!EXTRACT}} it stops. What I would do is use my mouse to click that text.

So when I looked at things about tagging I just got more confused. How do you use the extracted information to 'click' the text link?

I am sorry for my poor ability but I am very confused. :oops:

Thank you again for your help!
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Recording not capturing checkbox click

Post by chivracq » Wed Sep 30, 2020 7:36 pm

RayB wrote:
Wed Sep 30, 2020 7:08 pm
Hi chivracq,

I can see I am getting closer with your help. I modifies the code shown below to include your advice:

Code: Select all

VERSION BUILD=10021450
SET !ENCRYPTION NO
SET !EXTRACT_TEST_POPUP NO
SET !TIMEOUT_PAGE 900
' next line is for New Tab number
SET !VAR2 {{!LOOP}}
ADD !VAR2 1
SET !VAR3 {{!URLCURRENT}}
TAB T={{!LOOP}}
URL GOTO={{!VAR3}}
' next line tags the pic at !LOOP location
TAG POS={{!LOOP}} TYPE=IMG ATTR=ALT:*&&SRC:http://www.*******.net/gallery/data/*/thumbs/*&&TITLE:*&&CLASS:imgborder
' next line opens the taggeg pic for deletion
TAG POS=1 TYPE=A ATTR=TXT:Move/Delete* EXTRACT=HREF
PROMPT {{!EXTRACT}}
URL GOTO={{!EXTRACT}}
WAIT SECONDS=0.1
URL GOTO=javascript:window.scrollBy(0,420)
TAB OPEN
TAB T={{!VAR2}}
URL GOTO={{!VAR3}}
I used the PROMPT to see what was being extracted and it matched what inspector showed so it will change for each picture on the page. I run the macro using Play Loop set to the number of pictures on a page. But when the macro gets to the URL GOTO={{!EXTRACT}} it stops. What I would do is use my mouse to click that text.

So when I looked at things about tagging I just got more confused. How do you use the extracted information to 'click' the text link?

I am sorry for my poor ability but I am very confused. :oops:

Thank you again for your help!

Yeah well, "poor ability", if you are "poorly able" to anonymize your Site like in "SRC:http://www.*******.net/gallery/data/*/thumbs/*", then I can't help you further than what I've already done... :roll:
=> You need to try "Things"..., I can't "test" anything virtually on "www.xxx.net" in my Mind, ah-ah...! :twisted: , and yep, very good, 'PROMPT' is indeed the Way to follow your Vars and debug your Script... OK, good luck further, I guess I'm probably out... :|
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
RayB
Posts: 34
Joined: Sat Mar 28, 2015 4:19 pm

Re: Recording not capturing checkbox click

Post by RayB » Fri Oct 02, 2020 12:33 am

Hi chivracq,

It is a pay membership site so giving it to you and any others would do you no good.

I appreciate what you have done to help me.
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Recording not capturing checkbox click

Post by chivracq » Fri Oct 02, 2020 1:03 am

RayB wrote:
Fri Oct 02, 2020 12:33 am
Hi chivracq,

It is a pay membership site so giving it to you and any others would do you no good.

I appreciate what you have done to help me.

Yeah, well, then you could have mentioned that "directly", or I would have found out myself directly anyway when trying to have a Look and realizing that the Site is behind Login & Password... :idea:
(And even for Sites behind L&P, it's always possible to upload some 'html Save as' to the Thread/Forum... :idea: )

And you never now, I or some other (Advanced) User(s) could happen to already have an Account on this "secret" Site where they could test or already have a Working Script, or many Paying Sites often have a Demo or still offer Limited Free Access where the Functionality that you want would still be available... (Even if I don't create Accounts (anymore) on all Sites where Forum Users "have a Pb", ah-ah...!)

Users on the Forum who "really care" to anonymize their Script to keep the Site not mentioned usually do that only to prevent the "Competition" and other Users to be able to use "their" Script... :P
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply