Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Automation Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Automation Anywhere Post messages and questions related to Automation Software here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-28-2010, 03:59 PM
loera loera is offline
Junior Member
 
Join Date: Apr 2010
Posts: 10
Default If Variable -OR- If Web Control

Greetings,

So far lovin what this program can do!

I have run into a bit of a snag. I am traversing several webpages and come to a point where I get to a webpage that doesn't have a specific control to click on. I would just like to ignore them(the webpages without the proper web control) by using an If/else statement. However, when I try to use the "If Web Control" command it asks me for a URL. I would like it to look at my currently open webpage not go to a new one. The URL is actually stored in a variable but it won't accept a variable in the URL box.

The Second option was to convert the current webpage to a text file (source of the webpage) and look for the link using the "If Variable" command. Alas, I guess I just don't know what to put in the "Variable" text box. Even if I did know what to put in the Variable box, will it allow me to search a string in the file?

Your help is greatly appreciated.

-Loera
Reply With Quote
  #2 (permalink)  
Old 04-29-2010, 03:12 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

Regarding your queries,

1) You can try this, using 'Manage Web Control' command capture the control you want to look for (using any URL) and save the command. Then right click the command that you saved just now and select option, 'Convert to If Web Control Exists' from context menu. This command can work for all the WebPages if layout of webpage is same. Web recorder will take care of changing parameters in a URL. If you can provide URL of webpage, we can create specific sample for your reference.

2) Yes, using Extract Source:Web Recorder command you can get the source code of webpage into user variable and using 'If Variable' command can search any fix or variable string in same user variable.

Hope that helps.
Reply With Quote
  #3 (permalink)  
Old 04-29-2010, 06:54 AM
loera loera is offline
Junior Member
 
Join Date: Apr 2010
Posts: 10
Default

Thank you very much for the quick response.

I gave your suggestion a try and it seems to work but only some of the time. Here is the typical webite my task is searching:

ULS License - Industrial/Business Pool, Conventional License - WNWJ805 - CALL FARMS
You will notice a FREQUENCIES tab/link, that is the control I am looking for. The next three websites are ones that need to be in the ELSE statement because they don't have FREQUENCIES tab/link:

ULS License - TV Translator Relay License - WQKN578 - ONEIDA COUNTY TRANSLATOR DISTRICT

ULS License - Part 22 VHF/UHF Paging (excluding 931MHz) License - L000005656 - PacifiCorp

ULS License - Part 22 VHF/UHF Paging (excluding 931MHz) License - WPZG402 - Alpha Communications Sites, Inc.


When I looked in the Advanced View of the IF command it had all three checkboxes checked (CAPTION, INDEX and ATTRIBUTES). That was not working so I modified them as follows:
CAPTION had no information in the textbox so I deselected it.
INDEX had 28, I left it as is.
ATTRIBUTES had:
title = Frequencies
href = "licenseFreqSum.jsp?licKey=1684256"
I changed the <href> attribute to:
href = "licenseFreqSum.jsp?licKey*

Here is a list of websites that I run through that should follow this pattern in the if/else statement:
T, T, F, T, T, F, F

LIST:
ULS License - Industrial/Business Pool, Conventional License - WNHA375 - GOLDEN WEST IRRIGATION INC
ULS License - Industrial/Business Pool, Conventional License - WNWJ805 - CALL FARMS
ULS License - TV Translator Relay License - WQKN578 - ONEIDA COUNTY TRANSLATOR DISTRICT
ULS License - Industrial/Business Pool, Conventional License - WRC895 - CROP PRODUCTION SERVICES INC
ULS License - Industrial/Business Pool, Conventional License - WRP793 - ANDERSON, LARRY D
ULS License - Part 22 VHF/UHF Paging (excluding 931MHz) License - WPZG402 - Alpha Communications Sites, Inc.
ULS License - Part 22 VHF/UHF Paging (excluding 931MHz) License - L000005656 - PacifiCorp


Thanks again for your help,

-Loera
Reply With Quote
  #4 (permalink)  
Old 04-29-2010, 10:47 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

In this scenario, we need to enable Attribute checkbox only and edit 'href' tag to have variable for lickey like this,

href = "licenseFreqSum.jsp?licKey=$UserVariable$"

Using 'String Manipulation' command we can extract lickey from URL.

We have attached a sample task for reference. Please copy it under location, 'C:\...\My Documents\Automation Anywhere\Automation Anywhere\My Tasks' folder.

Task is logging the result of 'If Web Control Exists' condition in C:\results.txt.
Attached Files
File Type: atmn Sample4Loera.atmn (5.3 KB, 5 views)
Reply With Quote
  #5 (permalink)  
Old 04-29-2010, 12:41 PM
loera loera is offline
Junior Member
 
Join Date: Apr 2010
Posts: 10
Default

My apoligies. I did not put my AA version number in the original post.

I have: Automation Anywhere 5.5.2 Premier

I recieved this message when I try to look at the task you sent:

"Unable to edit this task as it has been created in the higher version."

Could you resend this task to me?

Also could you tell me or direct me to examples of how to use the IF VARIABLE commmand. The help menu just tells me about it.

Thanks again for all your help,

-Loera
Reply With Quote
  #6 (permalink)  
Old 04-30-2010, 04:23 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello Lorea,

Attached is the task amended in version 5.5.2.

Please let us know how it goes at your end.
Attached Files
File Type: atmn sample.atmn (4.2 KB, 3 views)
Reply With Quote
  #7 (permalink)  
Old 05-04-2010, 06:15 AM
loera loera is offline
Junior Member
 
Join Date: Apr 2010
Posts: 10
Default

Greetings!

I have good news and bad news. The bad news is that the first time I ran it it failed on one of the websites. The good news is that I couldn't get it to fail after that. Here is the output of my first five runs:

F - 1654686 <--This was the first run. It should have been "T"
T - 1684256
F - 3120809
T - 1761144
T - 1761891
F - 2574599
F - 3113259
T - 1654686
T - 1684256
F - 3120809
T - 1761144
T - 1761891
F - 2574599
F - 3113259
T - 1654686
T - 1684256
F - 3120809
T - 1761144
T - 1761891
F - 2574599
F - 3113259
T - 1654686
T - 1684256
F - 3120809
T - 1761144
T - 1761891
F - 2574599
F - 3113259
T - 1654686
T - 1684256
F - 3120809
T - 1761144
T - 1761891
F - 2574599
F - 3113259

Thanks for all your help on this.

To make this thread complete I would like some information on that question I asked before:

"Also could you tell me or direct me to examples of how to use the IF VARIABLE commmand. The help menu just tells me about it."

Thank you,

-loera
Reply With Quote
  #8 (permalink)  
Old 05-04-2010, 09:15 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

Regarding your question about first run, possibly the webpage takes time to load fully hence the control does not exists while executing If condition. We can specify time duration i.e. how long to wait for condition to be true with If command. You can specify the maximum time in the wait box and if the condition is satisfied earlier then it won't wait for the entire duration specified, it works as an intelligent delay. We have attached amended task.

For 'If Variable' example, open help manual for 'If-Else-Endif ' then click on 'Example' link on top-right corner. In that, read Example four (Create a task that prompts the user for a value, and if the user types “STOP,” the task stops.)

Hope that helps.
Attached Files
File Type: atmn Sample4Loera.atmn (5.3 KB, 2 views)
Reply With Quote
  #9 (permalink)  
Old 06-02-2010, 03:45 PM
loera loera is offline
Junior Member
 
Join Date: Apr 2010
Posts: 10
Default

Thanks again for all you help.

I have not been able to recreate the error.

On to other challenges on the task...

-loera
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 04:27 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved