If Checkbox is Checked if not Check it

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
jramirez99
Posts: 1
Joined: Mon Oct 01, 2018 4:01 am

If Checkbox is Checked if not Check it

Post by jramirez99 » Mon Oct 01, 2018 4:13 am

All,

I have a question about how to check a box if its not check, if the box is check move on the next box. I know some scripting is needed. But I am unable to determine how to use the EXTRACT=CHECKED. Basically I want to loop through the check boxes if one isn't check, initiate the click to check the box.

any assistance will be greatly appreciated.

Code: Select all

var macro; 
macro = "CODE:"; 
macro += "VERSION BUILD=1005 RECORDER=CR" + "\n";  
macro += "URL GOTO=https://www.arise.com" + "\n";  
macro += "" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm31" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm32" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm33" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm34" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm35" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm36" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm37" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm38" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm39" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm40" + "\n";  
macro += "" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst17 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst18 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst19 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst20 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst21 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst22 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst23 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst24 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst25 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst26 CONTENT=YES" + "\n";  
macro += "" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_btnSubmit" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n";  
macro += "" + "\n";  
iimPlay(macro);
chivracq
Posts: 8143
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: If Checkbox is Checked if not Check it

Post by chivracq » Wed Oct 03, 2018 5:52 am

jramirez99 wrote:All,

I have a question about how to check a box if its not check, if the box is check move on the next box. I know some scripting is needed. But I am unable to determine how to use the EXTRACT=CHECKED. Basically I want to loop through the check boxes if one isn't check, initiate the click to check the box.

any assistance will be greatly appreciated.

Code: Select all

var macro; 
macro = "CODE:"; 
macro += "VERSION BUILD=1005 RECORDER=CR" + "\n";  
macro += "URL GOTO=https://www.arise.com" + "\n";  
macro += "" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm31" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm32" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm33" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm34" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm35" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm36" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm37" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm38" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm39" + "\n";  
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm40" + "\n";  
macro += "" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst17 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst18 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst19 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst20 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst21 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst22 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst23 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst24 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst25 CONTENT=YES" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst26 CONTENT=YES" + "\n";  
macro += "" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_btnSubmit" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n";  
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n";  
macro += "" + "\n";  
iimPlay(macro);
Hum, interesting Use of "I know", => But...!, I'm not sure People stating "I know" ever get an Answer on Technical Forums, just saying... :idea:
=> "I know" (just as an Example :wink: ), that you didn't read the Forum Rules... :oops:
(Mini-Hint: Your FCI is completely unclear, read my Sig... (+ the Forum Rules of course...!))
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
Posts: 8143
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: If Checkbox is Checked if not Check it

Post by chivracq » Sun Oct 07, 2018 5:36 am

Hum, I thought you were going to post an Update, starting with your FCI of course, as I saw you were checking the Forum a bit earlier..., but nope... :(

Hum, OK..., I guess mentioning 3 Versions about your Config was probably already too "complicated", oh well..., fair enough... 8)
(But don't expect "too much" from iMacros in that case, I'm "afraid" you won't really be able to understand what it is meant for and how to "use" it a bit "properly" and "creatively", just saying...! :roll: )
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply