Extracting data in a new environment

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Extracting data in a new environment

Post by shaves » Wed Jun 14, 2017 8:45 pm

I have a macro that currently selects a value in a drop down list without any issues. The user is being "forced" to upgrade to a new version of the application. Of course the macro now has an issue with the first dropdown it encounters. I noticed the HTML is different (see below). In the current version, I'm able to extract all of the values from the dropdown. In the "upgrade", I can display the dropdown and select the appropriate value in the list (there is an outline around the value). However, I'm not able to actually select the value and complete the dropdown. It looks like the "uipgrade"uses a widget. should I be able to select values in the widget with iMacros? Let me know if you need any other information or have any questions. Thanks for the help..........

Operating System: Windows 7 / Service Pack 1
System Type" 32 bit
iMacros: 10.3.27.5830

Current code to select appropriate value in the drop down
IM = "CODE:"
IM = IM + "TAB T=1" + vbNewLine
IM = IM + "TAB CLOSEALLOTHERS" + vbNewLine
IM = IM + "SET !TIMEOUT 60" + vbNewLine
IM = IM + "TAG POS=1 TYPE=SELECT FORM=NAME:NoFormName ATTR=* CONTENT=$" & Var3(Q) + vbNewLine

PROD Environment
<select class="gwt-ListBox GJEWJWHDP-" aria-invalid="false" aria-required="true" autofocus="" style="text-align: left; vertical-align: middle;" is-selectable="unselectable"><option value="0">--- Select a Value ---</option><option value="1">03VP</option><option value="2">16RS</option><option value="3">16RV</option><option value="4">16VP</option><option value="5">21VP</option><option value="6">32VN</option><option value="7">48VP</option><option value="8">6AVP</option></select>

PREPROD
<div tabindex="0" class="DropdownWidget---dropdown_value DropdownWidget---placeholder" id="d5a5d4c434da9a92d9cb6e6ab2c2dd16_value" role="listbox" aria-expanded="false" aria-required="true" aria-controls="d5a5d4c434da9a92d9cb6e6ab2c2dd16_list" aria-labelledby="d5a5d4c434da9a92d9cb6e6ab2c2dd16" aria-activedescendant=""><!-- react-text: 26 -->--- Select a Value ---<!-- /react-text --></div>

<div tabindex="0" class="DropdownWidget---dropdown_value" id="d5a5d4c434da9a92d9cb6e6ab2c2dd16_value" role="listbox" aria-expanded="false" aria-required="true" aria-controls="d5a5d4c434da9a92d9cb6e6ab2c2dd16_list" aria-labelledby="d5a5d4c434da9a92d9cb6e6ab2c2dd16" aria-activedescendant=""><!-- react-text: 26 -->03VP<!-- /react-text --></div>
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extracting data in a new environment

Post by chivracq » Thu Jun 15, 2017 12:13 am

shaves wrote:I have a macro that currently selects a value in a drop down list without any issues. The user is being "forced" to upgrade to a new version of the application. Of course the macro now has an issue with the first dropdown it encounters. I noticed the HTML is different (see below). In the current version, I'm able to extract all of the values from the dropdown. In the "upgrade", I can display the dropdown and select the appropriate value in the list (there is an outline around the value). However, I'm not able to actually select the value and complete the dropdown. It looks like the "uipgrade"uses a widget. should I be able to select values in the widget with iMacros? Let me know if you need any other information or have any questions. Thanks for the help..........

Code: Select all

Operating System:  Windows 7 / Service Pack 1
System Type"          32 bit
iMacros:                  10.3.27.5830
Current code to select appropriate value in the drop down

Code: Select all

IM = "CODE:"
IM = IM + "TAB T=1" + vbNewLine
IM = IM + "TAB CLOSEALLOTHERS" + vbNewLine
IM = IM + "SET !TIMEOUT 60" + vbNewLine
IM = IM + "TAG POS=1 TYPE=SELECT FORM=NAME:NoFormName ATTR=* CONTENT=$" & Var3(Q) + vbNewLine
PROD Environment

Code: Select all

<select class="gwt-ListBox GJEWJWHDP-" aria-invalid="false" aria-required="true" autofocus="" style="text-align: left; vertical-align: middle;" is-selectable="unselectable"><option value="0">--- Select a Value ---</option><option value="1">03VP</option><option value="2">16RS</option><option value="3">16RV</option><option value="4">16VP</option><option value="5">21VP</option><option value="6">32VN</option><option value="7">48VP</option><option value="8">6AVP</option></select>
PREPROD

Code: Select all

<div tabindex="0" class="DropdownWidget---dropdown_value DropdownWidget---placeholder" id="d5a5d4c434da9a92d9cb6e6ab2c2dd16_value" role="listbox" aria-expanded="false" aria-required="true" aria-controls="d5a5d4c434da9a92d9cb6e6ab2c2dd16_list" aria-labelledby="d5a5d4c434da9a92d9cb6e6ab2c2dd16" aria-activedescendant=""><!-- react-text: 26 -->--- Select a Value ---<!-- /react-text --></div>

<div tabindex="0" class="DropdownWidget---dropdown_value" id="d5a5d4c434da9a92d9cb6e6ab2c2dd16_value" role="listbox" aria-expanded="false" aria-required="true" aria-controls="d5a5d4c434da9a92d9cb6e6ab2c2dd16_list" aria-labelledby="d5a5d4c434da9a92d9cb6e6ab2c2dd16" aria-activedescendant=""><!-- react-text: 26 -->03VP<!-- /react-text --></div>
Hum, "funny", you are the second Forum "Dinosaur" we see today on the Forum, from 2009 and you from 2008, ah-ah...!

But hum, for your Case, yep this new Env is using 'DIV's for the DDLB itself and for all Options, so your current 'TAG TYPE=SELECT' Statement will indeed not work anymore... You can try recording the Actions again but the 'TAG' Mode often has Pb's with such often dynamically built DDLB's and the "Solution" is usually to use the 'EVENT' Mode which can handle them correctly, but you are on iMB v10 and the 'EVENT' Mode only got implemented in iMB v11.x.

Some Workaround that sometimes works with such DDLB's, without using the 'EVENT' Mode, is either with the 'TAG' or 'CLICK X/Y' Mode to "open" the DDLB, then fire a mini-'WAIT' Statement of say "0.5" Sec, and then only to fire the "real" Statement (using the 'TAG' Mode normally, but try as well with the 'X/Y' Mode) to select the Option in the DDLB.
- (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...
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Re: Extracting data in a new environment

Post by shaves » Thu Jun 15, 2017 1:14 pm

Thanks for the quick reply. I'll will try your suggestions. I also have a machine with version 11, so I will try the event mode on that machine as well. Thanks for your help.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extracting data in a new environment

Post by chivracq » Thu Jun 15, 2017 1:31 pm

shaves wrote:Thanks for the quick reply. I'll will try your suggestions. I also have a machine with version 11, so I will try the event mode on that machine as well. Thanks for your help.
OK, I'll be interested by the "Results"... I reckon the 'EVENT' Mode on v11 will do the Trick... (Though I'm not sure anymore if the 'EVENT' Mode got implemented from v11 or only from v11.5... (And I'm too lazy at the moment to check the Release Notes, but I guess you'll find out quickly enough...))

But hum, stg else about "Workarounds" without the 'EVENT' Mode: If you look "deeper" at the HTML Source Code of your Page, there is often some Hidden ('INPUT') Field meant to record the Selection in the DDLB that you might be able to use "directly", bypassing the 'DIV' DDLB..., and it's then often this Hidden Field that is actually used by the Page / JavaScript on the Page for further Processing...
- (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...
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Re: Extracting data in a new environment

Post by shaves » Thu Jun 15, 2017 1:37 pm

Once I try your suggestions, I'll let you know the results..........
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Re: Extracting data in a new environment

Post by shaves » Thu Jun 15, 2017 9:01 pm

I've had a little success today. I've been working on a 64 bit machine with iMacros 11.0.246.4051. Your EVENT mode suggestion allowed me to select the appropriate value. Kind of. I was able to record selecting the correct record in the dropdown and then actually using the code in the macro to make that selection.

The problem is the selection was hardcode as xxxxxxxxx_4. There are only about 6 records in this dropdown in the upgraded environment. In Production, there can be 100 or more. Other dropdowns can have even more values than that. In the past, I've extracted the entire list and cycled through the list until I found the correct one. I'm hoping I can do the same thing here.

The biggest challenge I'm facing now is extract the list of values. I've used the Text Extraction Wizard to try and extract the list. It looks like I'm able to because I see the different values in the "Extracted:" section of the wizard. However, when I drop that code into my macro, it appears to run without any errors. However, nothing is actually extracted. Have you seen anything like this before?

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

Re: Extracting data in a new environment

Post by chivracq » Fri Jun 16, 2017 3:57 am

shaves wrote:I've had a little success today. I've been working on a 64 bit machine with iMacros 11.0.246.4051. Your EVENT mode suggestion allowed me to select the appropriate value. Kind of. I was able to record selecting the correct record in the dropdown and then actually using the code in the macro to make that selection.
=> "Kind of"... => What do you mean...!?
shaves wrote:The problem is the selection was hardcode as xxxxxxxxx_4. There are only about 6 records in this dropdown in the upgraded environment. In Production, there can be 100 or more. Other dropdowns can have even more values than that. In the past, I've extracted the entire list and cycled through the list until I found the correct one. I'm hoping I can do the same thing here.

The biggest challenge I'm facing now is extract the list of values. I've used the Text Extraction Wizard to try and extract the list. It looks like I'm able to because I see the different values in the "Extracted:" section of the wizard. However, when I drop that code into my macro, it appears to run without any errors. However, nothing is actually extracted. Have you seen anything like this before?

Thanks for your help......
Well, its always possible to extract all Options from a DDLB, with 'EXTRACT=TXTALL' for a "Standard" DDLB, could be done in "pure" 'EXTRACT=HTM', and thus now with your 'DIV' DDLB, can be done with "Extract=HTM" as well, at some "higher" 'DIV' Level...

Just checking the Thread quickly, you didn't post any URL, then sorry I cannot be most specific..., you need to understand the "Principle" by yourself and to use/apply it by yourself... :idea:
Last edited by chivracq on Fri Jun 16, 2017 4:37 pm, edited 2 times in total.
- (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...
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Re: Extracting data in a new environment

Post by shaves » Fri Jun 16, 2017 1:49 pm

Thanks again for the suggestion. I realized I did not include the URL. This application was developed by our company and I'm restricted from sharing access with outside parties. I appreciate the suggestions you have provided and will try them to see if I have any success with extract the data in these lists. Thanks for your time and consideration in helping me with my issues..........
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extracting data in a new environment

Post by chivracq » Fri Jun 16, 2017 5:05 pm

shaves wrote:Thanks again for the suggestion. I realized I did not include the URL. This application was developed by our company and I'm restricted from sharing access with outside parties. I appreciate the suggestions you have provided and will try them to see if I have any success with extract the data in these lists. Thanks for your time and consideration in helping me with my issues..........
Hum, corrected a few Typos in my previous Post... :oops:

OK..., even if you uploaded a Saveas of your Page to the Thread that wouldn't help I guess as I reckon the Content of the DDLB is generated dynamically from some Script... Well the "Technique" to extract all Options is first to "open" the DDLB (either with the 'TAG' or 'CLICK X/Y' or 'EVENT' + 'CLICK' or a "slow" Mouse Click which will record a "MOUSEMOVE' and you only keep the 'MOUSEDOWN' Statement), then you add '0.5' or '1' Sec 'WAIT Statement to allow for the DDLB to get populated, and then using your Browser Inspector to identify the Containing 'DIV' for all Options that you then should be able to extract with the 'TAG' Mode...
You can try as well a bit the "blind" Technique, as the Name/ID of the Containing 'DIV' is usually very similar to the Name/ID for each 'DIV' or 'SPAN' for the Options by "playing" with Wildcards and 'POS=n'...

After the Selection of an Option, it is possible that the DDLB will remain Open (because of the previous 'MOUSEDOWN' Statement to open it), you can then add some "fake" Click (using the 'TAG' or 'EVENT' Mode) on some "neutral" HTML Element to close it...

Well, good luck, ah-ah...!
- (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...
Post Reply