Alternative for Wait for Seconds for a LIST BOX to Load?

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 Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
Post Reply
jyotirmaya
Posts: 24
Joined: Wed Jul 27, 2016 6:25 pm

Alternative for Wait for Seconds for a LIST BOX to Load?

Post by jyotirmaya » Wed Aug 22, 2018 6:10 am

I am using Browser Firefox 48.0
iMacros for Firefox 9.0.3
Windows 7 Professional 64-bit Operating system

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
'Uses a Windows script to submit several datasets to a website, e. g. for filling an online database
TAB T=1     
' Specify input file (if !COL variables are used, IIM automatically assume a CSV format of the input file
'CSV = Comma Separated Values in each line of the file
SET !DATASOURCE DBMS.csv

'SET !DATASOURCE_COLUMNS 1
'Start at line 2 to skip the header in the file
SET !LOOP 2
'Increase the current position in the file with each loop 
SET !DATASOURCE_LINE {{!LOOP}}
        SET !EXTRACT_TEST_POPUP NO
        TAG POS=1 TYPE=LEGEND FORM=ID:aspnetForm ATTR=TXT:Select<SP>Location<SP>for<SP>RoR
        TAG POS=1 TYPE=TD ATTR=TXT:District
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlDistrict CONTENT=%5
        WAIT SECONDS=2
        TAG POS=1 TYPE=TD ATTR=TXT:Tahasil
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil CONTENT=%4
        WAIT SECONDS=2
        TAG POS=1 TYPE=TD ATTR=TXT:Village
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage CONTENT=%138
        WAIT SECONDS=2
        
TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%{{!COL1}}
       WAIT SECONDS=2
        TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_btnRORFront
        'TAG POS=1 TYPE=DIV ATTR=TXT:Schedule<SP>I<SP>Form<SP>No.39-A
        'TAG POS=1 TYPE=TD ATTR=TXT:ଥାନା<SP>ନମ୍ବର<SP>:<SP>"149"
        'Anchor:
        TAG POS=1 TYPE=TD ATTR=TXT:ଜମିଦାରଙ୍କ<SP>ନାମ<SP>ଓ<SP>ଖେୱାଟ<SP>ବା<SP>ଖତିୟାନର<SP>କ୍ରମିକ*
        'TAG POS=1 TYPE=TD ATTR=TXT:1)<SP>ଖତିୟାନର<SP>କ୍ରମିକ<SP>ନମ୍ବର
        SET !EXTRACT NULL
        TAG POS=R3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        SET My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:1
        SET !EXTRACT NULL
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:2)<SP>ପ୍ରଜାର<SP>ନାମ,<SP>ପିତାର<SP>ନାମ,<SP>ଜାତି<SP>ଓ<SP>ବାସସ୍ଥ*
        SET !EXTRACT NULL
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:3)<SP>ସ୍ଵତ୍ଵ
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:ସ୍ଥିତିବାନ
        SET !EXTRACT NULL
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'PROMPT {{!EXTRACT}}
        'PROMPT {{My_Data}}
        SET !CLIPBOARD {{My_Data}}
       TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:btnKhatiyan
        TAG POS=1 TYPE=TD ATTR=TXT:District
I am using the above code to extract data from web page. But in my website there are 4 List boxes and I am using WAIT SECONDS=2 four times in the code. But sometimes it is taking more than 2 seconds for load and the code stops, I tried !WAITPAGECOMPLETE but its not working in Firefox. What can be the alternative ?
chivracq
Posts: 8040
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Alternative for Wait for Seconds for a LIST BOX to Load?

Post by chivracq » Wed Aug 22, 2018 4:05 pm

jyotirmaya wrote:I am using

Code: Select all

Browser Firefox 48.0
iMacros for Firefox 9.0.3 
Windows 7 Professional 64-bit Operating system

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
'Uses a Windows script to submit several datasets to a website, e. g. for filling an online database
TAB T=1     
' Specify input file (if !COL variables are used, IIM automatically assume a CSV format of the input file
'CSV = Comma Separated Values in each line of the file
SET !DATASOURCE DBMS.csv

'SET !DATASOURCE_COLUMNS 1
'Start at line 2 to skip the header in the file
SET !LOOP 2
'Increase the current position in the file with each loop 
SET !DATASOURCE_LINE {{!LOOP}}
        SET !EXTRACT_TEST_POPUP NO
        TAG POS=1 TYPE=LEGEND FORM=ID:aspnetForm ATTR=TXT:Select<SP>Location<SP>for<SP>RoR
        TAG POS=1 TYPE=TD ATTR=TXT:District
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlDistrict CONTENT=%5
        WAIT SECONDS=2
        TAG POS=1 TYPE=TD ATTR=TXT:Tahasil
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil CONTENT=%4
        WAIT SECONDS=2
        TAG POS=1 TYPE=TD ATTR=TXT:Village
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage CONTENT=%138
        WAIT SECONDS=2
        
TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
        TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%{{!COL1}}
       WAIT SECONDS=2
        TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_btnRORFront
        'TAG POS=1 TYPE=DIV ATTR=TXT:Schedule<SP>I<SP>Form<SP>No.39-A
        'TAG POS=1 TYPE=TD ATTR=TXT:ଥାନା<SP>ନମ୍ବର<SP>:<SP>"149"
        'Anchor:
        TAG POS=1 TYPE=TD ATTR=TXT:ଜମିଦାରଙ୍କ<SP>ନାମ<SP>ଓ<SP>ଖେୱାଟ<SP>ବା<SP>ଖତିୟାନର<SP>କ୍ରମିକ*
        'TAG POS=1 TYPE=TD ATTR=TXT:1)<SP>ଖତିୟାନର<SP>କ୍ରମିକ<SP>ନମ୍ବର
        SET !EXTRACT NULL
        TAG POS=R3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        SET My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:1
        SET !EXTRACT NULL
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:2)<SP>ପ୍ରଜାର<SP>ନାମ,<SP>ପିତାର<SP>ନାମ,<SP>ଜାତି<SP>ଓ<SP>ବାସସ୍ଥ*
        SET !EXTRACT NULL
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:3)<SP>ସ୍ଵତ୍ଵ
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'TAG POS=1 TYPE=TD ATTR=TXT:ସ୍ଥିତିବାନ
        SET !EXTRACT NULL
        TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
        ADD My_Data {{!EXTRACT}}
        'PROMPT {{!EXTRACT}}
        'PROMPT {{My_Data}}
        SET !CLIPBOARD {{My_Data}}
       TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:btnKhatiyan
        TAG POS=1 TYPE=TD ATTR=TXT:District
I am using the above code to extract data from web page. But in my website there are 4 List boxes and I am using WAIT SECONDS=2 four times in the code. But sometimes it is taking more than 2 seconds for load and the code stops, I tried !WAITPAGECOMPLETE but its not working in Firefox. What can be the alternative ?
Yeah, well, there are other "Mechanisms" indeed you can use, and that will probably be more "reliable" than '!WAITPAGECOMPLETE' if it was supported on FF, but it depends a bit on how the Page/Site "behaves" once a DDLB Item has been selected, if "only' the "next" DDLB then gets dynamically populated depending on the Choice from the previous DDLB, or if the Page gets "completely" reloaded (or a new Page gets loaded), with new Content...

I don't see any '!TIMEOUT_xxx' Statement(s) in your Script, meaning you are using the Default Settings of 60 Sec + 6 Sec, you could already try playing with those 2 Settings, but I would think 6+2=8 Sec for '!TIMEOUT_STEP' is already more than long enough for the next 'TAG' to be found... Well, unless you've shortened '!TIMEOUT_PAGE' in the General iMacros Options...!

"But sometimes it is taking more than 2 seconds for load and the code stops, ..."
=> What RuntimeError do you get then, when "the Code stops"...?
And pay attention to the "Timing"...: Do you get that RuntimeError after 2 Sec (corresponding to the 'WAIT' Statement)...?, or after 8 Sec (the 'WAIT' + '!TIMEOUT_STEP')...?, or maybe even longer if the Page gets (re)loaded, and then iMacros will apply 60 + 2 + 8 = 68 Sec, I would think...?, euh nope, only 60 Sec in your Case as you don't use '!ERRORIGNORE'...

>>>

The way you construct your Extracted Data for the 'PROMPT' and the Clipboard is a little bit cumbersome btw..., as you don't seem to be doing any Manipulation at all on all the 'EXTRACT''s, there is an easier way if you simply want to remove all the "[EXTRACT]" Separators that iMacros automatically adds with consecutive Extracts...
=> You could better let iMacros do all the Extracts "naturally", and only remove the "[EXTRACT]" Separators at the last moment for the 'PROMPT' and the Clipboard, keeping the original '!EXTRACT' "intact", in case for example you (ever) want to save that Data as well to some '.CSV' File..., or you'll have to code the whole Functionality a 2nd time, which is not a "Best Practice", ah-ah...!

=> If you want to do like I suggest, you need to disable/remove all "SET !EXTRACT NULL" before each 'EXTRACT', and you create your 'My_Data' Var in just one single 'EVAL()' Statement like:

Code: Select all

SET My_Data EVAL("var s='{{!EXTRACT}}'; var x,y,z; z=s.split('[EXTRACT]').join('<BR>'); z;")
PROMPT EXTRACT:<BR>{{!EXTRACT}}<BR><BR>My_Data:<BR>{{My_Data}}
(Not tested...)
- (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...
jyotirmaya
Posts: 24
Joined: Wed Jul 27, 2016 6:25 pm

Re: Alternative for Wait for Seconds for a LIST BOX to Load?

Post by jyotirmaya » Wed Aug 22, 2018 5:52 pm

if "only' the "next" DDLB then gets dynamically populated depending on the Choice from the previous DDLB
Yes exactly, I have 4 list boxes and the 2nd one will be populated if 1st one is selected, and third one will populate if 2nd one will be selected and 4th one will be populated if third one wil be selected. All the List boxes are dependent on each other
I don't see any '!TIMEOUT_xxx' Statement(s) in your Script, meaning you are using the Default Settings of 60 Sec + 6 Sec, you could already try playing with those 2 Settings, but I would think 6+2=8 Sec for '!TIMEOUT_STEP' is already more than long enough for the next 'TAG' to be found... Well, unless you've shortened '!TIMEOUT_PAGE' in the General iMacros Options...!
I have set the the '!TIMEOUT' as 60 seconds in options, but the TIMEOUT' settings is not working while selecting List boxes, its only working while finding the next 'TAG' and I dont have any issues with that. I have set that 60 seconds and thats working good.

"But sometimes it is taking more than 2 seconds for load and the code stops, ..."
=> What RuntimeError do you get then, when "the Code stops"...?
And pay attention to the "Timing"...: Do you get that RuntimeError after 2 Sec (corresponding to the 'WAIT' Statement)...?, or after 8 Sec (the 'WAIT' + '!TIMEOUT_STEP')...?, or maybe even longer if the Page gets (re)loaded, and then iMacros will apply 60 + 2 + 8 = 68 Sec, I would think...?, euh nope, only 60 Sec in your Case as you don't use '!ERRORIGNORE'...
I am getting errors for the List boxes like
Entry [5] not available [Box has 0 entries], line: 19 (Error code: -924)
Entry [4] not available [Box has 0 entries], line: 19 (Error code: -924)
Entry [138] not available [Box has 1 entries], line: 22 (Error code: -924)

Yes I am getting the Error after waiting 2 seconds yes corresponding to the 'WAIT' statement.
No not after 8 seconds or 68 seconds, I am getting error after 2 seconds.
The way you construct your Extracted Data for the 'PROMPT' and the Clipboard is a little bit cumbersome btw..., as you don't seem to be doing any Manipulation at all on all the 'EXTRACT''s, there is an easier way if you simply want to remove all the "[EXTRACT]" Separators that iMacros automatically adds with consecutive Extracts...
=> You could better let iMacros do all the Extracts "naturally", and only remove the "[EXTRACT]" Separators at the last moment for the 'PROMPT' and the Clipboard, keeping the original '!EXTRACT' "intact", in case for example you (ever) want to save that Data as well to some '.CSV' File..., or you'll have to code the whole Functionality a 2nd time, which is not a "Best Practice", ah-ah...!
=> If you want to do like I suggest, you need to disable/remove all "SET !EXTRACT NULL" before each 'EXTRACT', and you create your 'My_Data' Var in just one single 'EVAL()' Statement like:
The code I am using is provided by you before 2 years ago :). I am using that and playing the code as LOOP and thats working and I am using a software Ditto to save the extracted data using iMacros to stored in the software hence no issues with extraction. I am facing issues with the list box.
chivracq
Posts: 8040
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Alternative for Wait for Seconds for a LIST BOX to Load?

Post by chivracq » Wed Aug 22, 2018 7:01 pm

jyotirmaya wrote:
if "only' the "next" DDLB then gets dynamically populated depending on the Choice from the previous DDLB
Yes exactly, I have 4 list boxes and the 2nd one will be populated if 1st one is selected, and third one will populate if 2nd one will be selected and 4th one will be populated if third one wil be selected. All the List boxes are dependent on each other
Hum, OK, that's a bit what I was "afraid" of, ah-ah...! Grr..., I "hate" those Sites with Dynamic Content, it often "goes wrong", that kind of Dynamic Functionality is not always very-very "reliable", the Page often needs to be reloaded completely for all that Background JS to finally "accept" to work... :(
jyotirmaya wrote:
I don't see any '!TIMEOUT_xxx' Statement(s) in your Script, meaning you are using the Default Settings of 60 Sec + 6 Sec, you could already try playing with those 2 Settings, but I would think 6+2=8 Sec for '!TIMEOUT_STEP' is already more than long enough for the next 'TAG' to be found... Well, unless you've shortened '!TIMEOUT_PAGE' in the General iMacros Options...!
I have set the the '!TIMEOUT' as 60 seconds in options, but the TIMEOUT' settings is not working while selecting List boxes, its only working while finding the next 'TAG' and I dont have any issues with that. I have set that 60 seconds and thats working good.
OK, all Default Settings, and "playing" with '!TIMEOUT_STEP' won't really help indeed...
jyotirmaya wrote:
"But sometimes it is taking more than 2 seconds for load and the code stops, ..."
=> What RuntimeError do you get then, when "the Code stops"...?
And pay attention to the "Timing"...: Do you get that RuntimeError after 2 Sec (corresponding to the 'WAIT' Statement)...?, or after 8 Sec (the 'WAIT' + '!TIMEOUT_STEP')...?, or maybe even longer if the Page gets (re)loaded, and then iMacros will apply 60 + 2 + 8 = 68 Sec, I would think...?, euh nope, only 60 Sec in your Case as you don't use '!ERRORIGNORE'...
I am getting errors for the List boxes like
Entry [5] not available [Box has 0 entries], line: 19 (Error code: -924)
Entry [4] not available [Box has 0 entries], line: 19 (Error code: -924)
Entry [138] not available [Box has 1 entries], line: 22 (Error code: -924)

Yes I am getting the Error after waiting 2 seconds yes corresponding to the 'WAIT' statement.
No not after 8 seconds or 68 seconds, I am getting error after 2 seconds.
Yep-yep-yep...! OK, the 2 Sec are "logical" then, as the DDLB is indeed already present on the Page, so iMacros finds it directly with the 'TAG' Statement, it's only that it has not been populated yet, so the Entry in not found and iMacros doesn't wait/retry, '!TIMEOUT_STEP' only applies to the "main" Element, not to the "Sub-Elements" within that DDLB...

"Solution" I would have for you would be to add 1 or 2 "Conditional" 'WAIT'(s) to allow for more time for the DDLB's to get populated, if needed, by first firing an "EXTRACT=TXTALL" on the DDLB and using 'EVAL()' and checking on the Length of the 'EXTRACT' if the DDLB is still empty or if it has been populated to spit out another extra few Seconds (or "0") for the Conditional 'WAIT'.
And you do that once or maybe twice..., it is still not 100% reliable in case the DDLB really didn't get populated, and won't...!, then you could add a 3rd Check meaning that stg really went wrong with the Page and that DDLB, to trigger some Conditional 'PAUSE' or 'PROMPT' to require some manual User Action... :idea:
It's a little bit "cumbersome" but I don't see any other way to control/check that the DDLB has been populated correctly...
jyotirmaya wrote:
The way you construct your Extracted Data for the 'PROMPT' and the Clipboard is a little bit cumbersome btw..., as you don't seem to be doing any Manipulation at all on all the 'EXTRACT''s, there is an easier way if you simply want to remove all the "[EXTRACT]" Separators that iMacros automatically adds with consecutive Extracts...
=> You could better let iMacros do all the Extracts "naturally", and only remove the "[EXTRACT]" Separators at the last moment for the 'PROMPT' and the Clipboard, keeping the original '!EXTRACT' "intact", in case for example you (ever) want to save that Data as well to some '.CSV' File..., or you'll have to code the whole Functionality a 2nd time, which is not a "Best Practice", ah-ah...!
=> If you want to do like I suggest, you need to disable/remove all "SET !EXTRACT NULL" before each 'EXTRACT', and you create your 'My_Data' Var in just one single 'EVAL()' Statement like:
The code I am using is provided by you before 2 years ago :). I am using that and playing the code as LOOP and thats working and I am using a software Ditto to save the extracted data using iMacros to stored in the software hence no issues with extraction. I am facing issues with the list box.
Hum, I thought I recognize "my Style" a little bit, ah-ah...! 8)
Oh well, if that Code comes from me, then it must be good, ah-ah...! :wink:

It is indeed a "way" to do it, only maybe a little bit "too powerful" in your Case, and actually meant to give you the Possibility after each 'EXTRACT' to "clean" the Data if needed, if for example some extra Spaces or Soft Returns are included in the Extract..., which apparently is not the Case as you don't do any "Cleaning"..., then the 2nd Method I gave you in my last Reply would be "easier"...
I guess I could never check your Site/Page/Data 2 years ago in that previous Thread, then I gave you the most "powerful"/"flexible" Method in case you needed/wanted to add some extra Functionality/Control on your Data, ah-ah...! 8)
- (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...
jyotirmaya
Posts: 24
Joined: Wed Jul 27, 2016 6:25 pm

Re: Alternative for Wait for Seconds for a LIST BOX to Load?

Post by jyotirmaya » Thu Aug 23, 2018 2:09 pm

"Solution" I would have for you would be to add 1 or 2 "Conditional" 'WAIT'(s) to allow for more time for the DDLB's to get populated, if needed, by first firing an "EXTRACT=TXTALL" on the DDLB and using 'EVAL()' and checking on the Length of the 'EXTRACT' if the DDLB is still empty or if it has been populated to spit out another extra few Seconds (or "0") for the Conditional 'WAIT'.
sorry but I tried to make the coding, but unable to make it
I guess I could never check your Site/Page/Data 2 years ago in that previous Thread, then I gave you the most "powerful"/"flexible" Method in case you needed/wanted to add some extra Functionality/Control on your Data, ah-ah...! 8)
the website is http://164.100.140.80/RoRView.aspx
Image

In the above Image there are 4 List box those are District, Tahasil, Village and Select Khatiyan No.
In my case I want the 1st list box content to be selected as content 5 and 2nd one content 4 and third one content as 138 and I am using the Select Khatiyan number List box from a CSV file.
chivracq
Posts: 8040
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Alternative for Wait for Seconds for a LIST BOX to Load?

Post by chivracq » Thu Aug 23, 2018 5:53 pm

jyotirmaya wrote:
"Solution" I would have for you would be to add 1 or 2 "Conditional" 'WAIT'(s) to allow for more time for the DDLB's to get populated, if needed, by first firing an "EXTRACT=TXTALL" on the DDLB and using 'EVAL()' and checking on the Length of the 'EXTRACT' if the DDLB is still empty or if it has been populated to spit out another extra few Seconds (or "0") for the Conditional 'WAIT'.
sorry but I tried to make the coding, but unable to make it
I guess I could never check your Site/Page/Data 2 years ago in that previous Thread, then I gave you the most "powerful"/"flexible" Method in case you needed/wanted to add some extra Functionality/Control on your Data, ah-ah...! 8)
the website is http://164.100.140.80/RoRView.aspx
Image

In the above Image there are 4 List box those are District, Tahasil, Village and Select Khatiyan No.
In my case I want the 1st list box content to be selected as content 5 and 2nd one content 4 and third one content as 138 and I am using the Select Khatiyan number List box from a CSV file.
Hum..., "sorry but I tried to make the coding, but unable to make it"..., not sure what you "tried", you don't post any Script/Attempt with an "EXTRACT=TXTALL" like I mentioned, it's not complicated at all...

But OK, here is a Demonstration of the Functionality:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !EXTRACT_TEST_POPUP NO
'URL GOTO=http://164.100.140.80/RoRView.aspx

'Easy Access:
SET DDLB_WAIT 2
SET DDLB_WAIT_Extra 3

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tddist
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlDistrict CONTENT=%5

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tdtah
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
'PROMPT EXTRACT<BR>_{{!EXTRACT}}_<BR><BR>WAIT_Extra:<SP>_{{WAIT_Extra}}_
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil CONTENT=%4

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tdvill
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage CONTENT=%138

TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%17
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10_x64.)

You can "play with"/tune the 2 "Easy Access" Vars at the beginning of the Script if you want to modify all Values in just one Place, 'DDLB_WAIT' is your original hard-coded 2 Sec, and the 'DDLB_WAIT_Extra' is the extra/conditional 'WAIT'...
If you want to test the Script, you can set 'DDLB_WAIT' to "1" (probably too short) or even "0" (definitely too short...!), and you will see that 'DDLB_WAIT_Extra' "catches" on 'DDLB_WAIT' being too short...!

You could even repeat the Block with 'WAIT_Extra' if you want to "split" the Extra 'WAIT' into 2 parts...

Enjoy...! 8)
- (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...
jyotirmaya
Posts: 24
Joined: Wed Jul 27, 2016 6:25 pm

Re: Alternative for Wait for Seconds for a LIST BOX to Load?

Post by jyotirmaya » Thu Aug 23, 2018 6:26 pm

not sure what you "tried", you don't post any Script/Attempt with an "EXTRACT=TXTALL" like I mentioned, it's not complicated at all...
Its not complicated for you :) , but it is for me :lol:

You can "play with"/tune the 2 "Easy Access" Vars at the beginning of the Script if you want to modify all Values in just one Place, 'DDLB_WAIT' is your original hard-coded 2 Sec, and the 'DDLB_WAIT_Extra' is the extra/conditional 'WAIT'...
If you want to test the Script, you can set 'DDLB_WAIT' to "1" (probably too short) or even "0" (definitely too short...!), and you will see that 'DDLB_WAIT_Extra' "catches" on 'DDLB_WAIT' being too short...!

Yes it is working. Thanks for the guidance.

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !EXTRACT_TEST_POPUP NO
'URL GOTO=http://164.100.140.80/RoRView.aspx

'Easy Access:
SET DDLB_WAIT 2
SET DDLB_WAIT_Extra 3

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tddist
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlDistrict CONTENT=%5

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tdtah
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
'PROMPT EXTRACT<BR>_{{!EXTRACT}}_<BR><BR>WAIT_Extra:<SP>_{{WAIT_Extra}}_
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil CONTENT=%4

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tdvill
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage CONTENT=%138

TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%17
This works perfectly. Thank you so Much Again :) :)
chivracq
Posts: 8040
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Alternative for Wait for Seconds for a LIST BOX to Load?

Post by chivracq » Thu Aug 23, 2018 6:47 pm

jyotirmaya wrote:
not sure what you "tried", you don't post any Script/Attempt with an "EXTRACT=TXTALL" like I mentioned, it's not complicated at all...
Its not complicated for you :) , but it is for me :lol:
You can "play with"/tune the 2 "Easy Access" Vars at the beginning of the Script if you want to modify all Values in just one Place, 'DDLB_WAIT' is your original hard-coded 2 Sec, and the 'DDLB_WAIT_Extra' is the extra/conditional 'WAIT'...
If you want to test the Script, you can set 'DDLB_WAIT' to "1" (probably too short) or even "0" (definitely too short...!), and you will see that 'DDLB_WAIT_Extra' "catches" on 'DDLB_WAIT' being too short...!
Yes it is working. Thanks for the guidance.

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !EXTRACT_TEST_POPUP NO
'URL GOTO=http://164.100.140.80/RoRView.aspx

'Easy Access:
SET DDLB_WAIT 2
SET DDLB_WAIT_Extra 3

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tddist
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlDistrict CONTENT=%5

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tdtah
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
'PROMPT EXTRACT<BR>_{{!EXTRACT}}_<BR><BR>WAIT_Extra:<SP>_{{WAIT_Extra}}_
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil CONTENT=%4

TAG POS=1 TYPE=TD ATTR=ID:ctl00_ContentPlaceHolder1_tdvill
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage CONTENT=%138

TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
WAIT SECONDS={{DDLB_WAIT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage EXTRACT=TXTALL
SET WAIT_Extra EVAL("var s='{{!EXTRACT}}', dwe='{{DDLB_WAIT_Extra}}'; var x,y,z; x=s.split('[OPTION]'); y=x.length; if(y>1){z=0;} else{z=dwe;}; z;")
WAIT SECONDS={{WAIT_Extra}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%17
This works perfectly. Thank you so Much Again :) :)
OK, good to hear...! :D

And your Thread "made it" to the "Interesting Threads of the Month" Thread for August 2018, ah-ah...! 8)
- (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