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++.

Moderators: Community Moderators, iMacros Moderators

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.

Extracting data in a new environment

by shaves on Wed Jun 14, 2017 1: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>
shaves
 
Posts: 54
Joined: Tue Apr 29, 2008 11:50 am

Re: Extracting data in a new environment

by chivracq on Wed Jun 14, 2017 5:13 pm

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)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: 6276
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting data in a new environment

by shaves on Thu Jun 15, 2017 6:14 am

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.
shaves
 
Posts: 54
Joined: Tue Apr 29, 2008 11:50 am

Re: Extracting data in a new environment

by chivracq on Thu Jun 15, 2017 6:31 am

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)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: 6276
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting data in a new environment

by shaves on Thu Jun 15, 2017 6:37 am

Once I try your suggestions, I'll let you know the results..........
shaves
 
Posts: 54
Joined: Tue Apr 29, 2008 11:50 am

Re: Extracting data in a new environment

by shaves on Thu Jun 15, 2017 2: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......
shaves
 
Posts: 54
Joined: Tue Apr 29, 2008 11:50 am

Re: Extracting data in a new environment

by chivracq on Thu Jun 15, 2017 8:57 pm

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 9:37 am, edited 2 times in total.
- (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: 6276
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting data in a new environment

by shaves on Fri Jun 16, 2017 6:49 am

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..........
shaves
 
Posts: 54
Joined: Tue Apr 29, 2008 11:50 am

Re: Extracting data in a new environment

by chivracq on Fri Jun 16, 2017 10:05 am

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)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: 6276
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 6 guests

-->