This may be somewhat of a primitive approach, but the following code
worked well for me in a similar situation. It simply mimics the key
strokes that someone sitting at a keyboard would use to navigate around
the web page.
'tab to transaction type selection list
Wait 0.4
For X = 1 To 3
SendKeys "{tab}", True
Wait 0.2
Next X
' Highlight desired selection on list
Wait 0.4
If Left(Share("FileName", ssGlobal), 3) = "F15" Then
For X = 1 To 4
SendKeys "{down}", True
Wait 0.2
Next X
ElseIf Left(Share("FileName", ssGlobal), 3) = "F92" Then
For X = 1 To 3
SendKeys "{down}", True
Wait 0.2
Next X
End If
'tab to submit button
Wait 0.4
SendKeys "{tab}", True
Wait 0.4
SendKeys "{enter}", True
Eric Pitzer
PNC Financial Services Group, Inc.
Xpack Network Services Division
1-800-919-7749
Brian Van Grinsven <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
07/06/2007 01:47 PM
Please respond to
[email protected]
To
[email protected]
cc
Subject
RE: [Talk] Drop Down Code
if you are able to right click on the page and do a "View Source"
do a search for "<select"
after that tag (<select name="something">)
you should see the options you are trying to select.
If you can't find a "<select" then it's most likely a control or as you
said it could be a Java based control.
...................................
Brian Van Grinsven
Integrated Systems Specialist
Medbuy Corporation
mailto:[EMAIL PROTECTED]
http://www.medbuy.ca
T: 519.652.1688 ext. 114
F: 519.652.2788
Technical Support:
ext. 199 or [EMAIL PROTECTED]
Building Partnerships in Healthcare
"Bennett, Brian" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
07/06/2007 02:39 PM
Please respond to
[email protected]
To
"'[email protected]'" <[email protected]>
cc
Subject
RE: [Talk] Drop Down Code
Thanks. I'm beginning to think the drop-down on this site (Netwerkes.com)
is not HTML, but Java. Nothing I try either links to the element or if I
do get a mouse click it only highlights and does not actually select the
option.
Anyone using BWS to manipulate Netwerkes.com and the dropdowns??
Thanks.
Brian Bennett
Systems Analyst
Affinity Health Systems
Clinic Billing
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brian Van Grinsven
Sent: Friday, July 06, 2007 11:03 AM
To: [email protected]
Subject: Re: [Talk] Drop Down Code
Sub GetListItem(ItemName As String)
dim i as long ' Need to i declared to get rid of the error message you
have
dim e as object ' Same with this one (I probably have the incorrect
variable type as I don't work with web)
Set e = Web.Selected ' This makes "e" associated to the select box
For i = 0 To e.options.length ' count from 0 to the number of options
within your select box (this is just in case stuff changes)
OptName = e.options(i).innerHTML ' What's the option name
If ItemName = e.options(i).innerHTML Then ' If ItemName is the same
as the current option then goto the next statement
e.selectedindex = i ' Force the Current option (i) to be
selected
Exit Sub ' Exit out of this procedure
End If ' End the IF statement
Next ' Continue Counting
End Sub ' End the Procedure
...................................
Brian Van Grinsven
Integrated Systems Specialist
Medbuy Corporation
mailto:[EMAIL PROTECTED]
http://www.medbuy.ca
T: 519.652.1688 ext. 114
F: 519.652.2788
Technical Support:
ext. 199 or [EMAIL PROTECTED]
Building Partnerships in Healthcare
"Bennett, Brian" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
07/06/2007 11:46 AM
Please respond to
[email protected]
To
"'[email protected]'" <[email protected]>
cc
Subject
[Talk] Drop Down Code
Since I am not a programmer and each new script or task is a new adventure
in misery is there anyone who can explain this code in layman terms?
Sub GetListItem(ItemName As String)
Set e = Web.Selected
For i = 0 To e.options.length
OptName = e.options(i).innerHTML
If ItemName = e.options(i).innerHTML Then
e.selectedindex = i
Exit Sub
End If
Next
End Sub
This is the code example from the HTML dropdown question in V. talk
archives. I've got the first part working but get an object not defined
error at "Set e=" and also fail at "For i=" I'm guessing that For i = 0
to e.options.length would read For i = 0 to 6, Since that is the number of
choices on the dropdown I am working with?
Thanks.
Brian Bennett
Systems Analyst
Affinity Health Systems
Clinic Billing
628-9055
[EMAIL PROTECTED]
**********************************************************************
This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient, please
notify the sender immediately by return e-mail, delete this e-mail and
destroy any copies. Any dissemination or use of this information by a
person other than the intended recipient is unauthorized and may be
illegal.
**********************************************************************
**********************************************************************
This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient, please
notify the sender immediately by return e-mail, delete this e-mail and
destroy any copies. Any dissemination or use of this information by a
person other than the intended recipient is unauthorized and may be
illegal.
**********************************************************************
The contents of this email are the property of PNC. If it was not addressed to
you, you have no legal right to read it. If you think you received it in error,
please notify the sender. Do not forward or copy without permission of the
sender. This message may contain an advertisement of a product or service and
thus may constitute a commercial electronic mail message under US Law. PNCs
postal address is 249 Fifth Avenue, Pittsburgh, PA 15222. If you do not wish to
receive any additional advertising or promotional messages from PNC at this
e-mail address, click here to Unsubscribe.
https://pnc.p.delivery.net/m/u/pnc/uni/p.asp By unsubscribing to this message,
you will be unsubscribed from all advertising or promotional messages from PNC.
Removing your e-mail address from this mailing list will not affect your
subscription to alerts, e-newsletters or account servicing e-mails.