Tamilselvan wrote: ↑Sat Jun 05, 2021 4:29 am
Now i have modified some things. Its working me only when no rows/ records found in each tab.
Code: Select all
var FTO_Genrt,i,j,loop1;
FTO_Genrt = "CODE:"
var Tab_Open;
Tab_Open = "CODE:";
Tab_Open+= "SET !VAR2 2" + "\n";
Tab_Open+="TAB T={{!VAR2}}" + "\n";
for(i=2;i<=7;i++)
{
j=1;
loop1=1;
FTO_Genrt += "SET !EXTRACT NULL\n";
iimSet("j",j);
iimPlay("CODE: TAG POS={{j}} TYPE=TD ATTR=TXT:No<SP>wage<SP>list<SP>found EXTRACT=TXT" +"\n");
if(iimGetLastExtract()!='No wage list found')
{
do
{
FTO_Genrt += "SET !EXTRACT NULL" + "\n";
FTO_Genrt += "TAG POS={{loop1}} TYPE=INPUT:RADIO FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_wage_list_verify_ctl*_auth" + "\n"
FTO_Genrt += "TAG POS={{loop1}} TYPE=INPUT:RADIO FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_wage_list_verify_ctl*_auth EXTRACT=TXT" + "\n";
if(iimGetLastExtract()!='auth')
{
iimSet("loop1",loop1);
iimPlay(FTO_Genrt);
loop1++;
}
else
{
break;
}
}while(loop1<250);
FTO_Genrt += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ch_verifiedTAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ch_verified"+ "\n";;
FTO_Genrt += "WAIT SECONDS=0.5" + "\n";
FTO_Genrt += "ONDIALOG POS=1 BUTTON=OK CONTENT" + "\n";
FTO_Genrt += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_btn" + "\n";
FTO_Genrt += "WAIT SECONDS=0.5" + "\n";
}
else
{
Tab_Open += "ADD !VAR2 1" + "\n";
iimSet("i",i);
iimPlay(Tab_Open);
}
}
if rows found... one time only select rows and stayed on
Code: Select all
iimPlay("CODE: TAG POS={{j}} TYPE=TD ATTR=TXT:No<SP>wage<SP>list<SP>found EXTRACT=TXT" +"\n");
I am not familiar with this. I need your help... I want to select depending on no.of rows in each tab
Code: Select all
if(iimGetLastExtract()!='No wage list found')
{
do
{
FTO_Genrt += "SET !EXTRACT NULL" + "\n";
FTO_Genrt += "TAG POS={{loop1}} TYPE=INPUT:RADIO FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_wage_list_verify_ctl*_auth" + "\n"
FTO_Genrt += "TAG POS={{loop1}} TYPE=INPUT:RADIO FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_wage_list_verify_ctl*_auth EXTRACT=TXT" + "\n";
if(iimGetLastExtract()!='auth')
{
iimSet("loop1",loop1);
iimPlay(FTO_Genrt);
loop1++;
}
else
{
break;
}
}while(loop1<250);
Thanks for being Patience....
Alright, one week later, but you put some "Effort" in your Posts, and you've followed my Advice not to use "!" in your User-Defined Vars..., good...!
Then OK, I see indeed some Pb in your Script, which indeed corresponds to the Part that you've isolated in your 2nd Script...:
The 'iimGetLastExtract()' is Undefined in your "if(iimGetLastExtract()!='auth')" as I guess you are checking on the 'EXTRACT' from "TAG POS={{loop1}} TYPE=INPUT:RADIO FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_wage_list_verify_ctl*_auth EXTRACT=TXT", but you haven't executed "FTO_Genrt" yet...
(Or actually 'iimGetLastExtract()' does contain a Value, but it still contains the Value from the previous Script you executed, and that was the 'EXTRACT' from the TAG POS={{j}} TYPE=TD ATTR=TXT:No<SP>wage<SP>list<SP>found EXTRACT=TXT", which is not what you want, I would think...
=> It will still contain "No wage list found" or "#EANF#", but for sure will never contain "auth", so that Condition will always be True...!)
=> You need an 'iimPlay()' before doing a Condition on the Result of the 'EXTRACT' from that Script...
>>>
Then a mini-Mistake...:
The 'iimSet()' in this part:
Code: Select all
iimSet("i",i);
iimPlay(Tab_Open);
... has no Use, as you don't use any "i" Var in that "Tab_Open" Script. (Only a '!VAR2' Var..., which is defined/declared inside the '.iim' Script, not at the '.js' Level.)
But no big deal, that Line simply does nothing...
>>>
And hum..., the overall Logic with for/if/else/while/if/else in your Script is fairly complex, with 2 different Scripts ("Tab_Open" + "FTO_Genrt"), and both constructed in 2 Parts, if I was writing this Script 'for myself", I would think it might be easier (for yourself, or sbd trying to understand your Script), if you declared/constructed those 2 or actually 4 Scripts at the beginning of your Script, before doing the whole "for/if/else/while/if/else" Workflow...
But you will need 4 Scripts/Strings...
Oh...!, sorry...!: "FTO_Genrt" is constructed in 3 Parts, and "Tab_Open" in 2 Parts, => you'll need 5 Strings (different Names) in total, and not 4...
Well, 4 Strings is actually enough, because the 1st Part of 'FTO_Genrt' does nothing as it only contains 1 Line with a "SET !EXTRACT NULL" which is never "really" needed at the beginning of a Macro as '!EXTRACT' is already Null anyway, and that same Line is repeated anyway also at the beginning of Part_2...
And if I'm correct (sorry, but it's not very easy to "mentally" debug your Script with all the "for/if/else/while/if/else" Loops and Conditions...), I think that the 3rd Part of 'FTO_Genrt' never gets executed...
Only the 2nd Part gets (always!) executed as it is based on the 'if' Condition that I mentioned already, is always True...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...