Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to (Click or Select) IE web page Tab

Status
Not open for further replies.

nrm3

Technical User
Jan 26, 2009
12
US
I have figured out how to launch an Attachmate script that will open a browser,login to a web site. After login, the web page has 5 tabs at the top of the page.
Each tab represents a different page on the site.
I cannot figure out how to click or select a tab on the web page or navigate to another page.

I have looked at the html for the page. The main document is Form1. There is a Tab Table. How do you select or click a tab from this table. I need to click or select the
Tab (id="TabControl_imgTab3a")

Does anybody have any ideas?

This is my Attachmate script

Sub Main
Dim UserName as String
Dim Passwrd as String
Dim oIE as object
Dim oElements as object
Dim oElement as object
UserName = "yxmnwkl"
Passwrd = "yxmnwkl"
sURL = " Set oIE = CreateObject("InternetExplorer.Application")
oIE.navigate(sURL)
oIE.visible = True


While oIE.Busy
Doevents
Wend

Set oElements = oIE.Document.Form1("select")


Set oElement = oIE.Document.Form1.txtCUID
oElement.Value = UserName


Set oElement = oIE.Document.Form1.txtPasswd
oElement.Value = Passwrd

oIE.document.all.Item("btnLogon").Click

End Sub




************************************************************************This is the HTML for the page after login

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Ticket Queue</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content=" name="vs_targetSchema">
<META HTTP-EQUIV="Refresh" CONTENT="15;" url="TktQueue.aspx">
<!-- stylesheet link --><LINK href="shared/estyles.css" type="text/css" rel="stylesheet">
</HEAD>
<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0"
bgColor="#ffffff"> <!-- banner + tab table -->
<form name="Form1" method="post" action="TktQueue.aspx"
<!-- -------------tab table ------------------------------------------------------------------------------------------- -->

<table cellSpacing="0" cellPadding="0" width="388" background="" border="0">
<tr>
<td><IMG height="22" src="images/spacer.gif" width="2"></td>
<!-- Tab 0 Begin-->
<td align="right"><img src="images/tabs/tab_white_left.gif" id="TabControl_imgTab0a" height="22" width="11" /></td>
<td id="TabControl_tdTab0" nowrap="nowrap" align="center" width="100" bgcolor="#FFFFFF"><B>Ticket Queue</B></td>

<td align="left"><img src="images/tabs/tab_white_right.gif" id="TabControl_imgTab0b" height="22" width="11" /></td>
<!-- Tab 0 End-->
<td><IMG height="22" src="images/spacer.gif" width="2"></td>
<!-- Tab 1 Begin-->
<td align="right"><img src="images/tabs/tab_blue_left.gif" id="TabControl_imgTab1a" height="22" width="11" /></td>
<td id="TabControl_tdTab1" nowrap="nowrap" align="center" width="100" background="images/tabs/tab_blue_bg.gif"><a id="TabControl_hlTab1" href="TktWorkList.aspx" style="color:DarkBlue;font-weight:bold;">Work List</a></td>

<td align="left"><img src="images/tabs/tab_blue_right.gif" id="TabControl_imgTab1b" height="22" width="11" /></td>
<!-- Tab 1 End-->
<td><IMG height="22" src="images/spacer.gif" width="2"></td>
<!-- Tab 2 Begin-->
<td align="right"><img src="images/tabs/tab_blue_left.gif" id="TabControl_imgTab2a" height="22" width="11" /></td>
<td id="TabControl_tdTab2" nowrap="nowrap" align="center" width="100" background="images/tabs/tab_blue_bg.gif"><a id="TabControl_hlTab2" href="TktControl.aspx" style="color:DarkBlue;font-weight:bold;">Ticket Control</a></td>

<td align="left"><img src="images/tabs/tab_blue_right.gif" id="TabControl_imgTab2b" height="22" width="11" /></td>
<!-- Tab 2 End-->
<td><IMG height="22" src="images/spacer.gif" width="2"></td>
<!-- Tab 3 Begin-->
<td align="right"><img src="images/tabs/tab_blue_left.gif" id="TabControl_imgTab3a" height="22" width="11" /></td>
<td id="TabControl_tdTab3" nowrap="nowrap" align="center" width="100" background="images/tabs/tab_blue_bg.gif"><a id="TabControl_hlTab3" href="TktSearch.aspx" style="color:DarkBlue;font-weight:bold;">Search</a></td>

<td align="left"><img src="images/tabs/tab_blue_right.gif" id="TabControl_imgTab3b" height="22" width="11" /></td>
<!-- Tab 3 End-->
<td><IMG height="22" src="images/spacer.gif" width="2"></td>
<!-- Tab 4 Begin-->
<td align="right"><img src="images/tabs/tab_blue_left.gif" id="TabControl_imgTab4a" height="22" width="11" /></td>
<td id="TabControl_tdTab4" nowrap="nowrap" align="center" width="100" background="images/tabs/tab_blue_bg.gif"><a id="TabControl_hlTab4" href="TktEntry.aspx" style="color:DarkBlue;font-weight:bold;">Ticket Entry</a></td>

<td align="left"><img src="images/tabs/tab_blue_right.gif" id="TabControl_imgTab4b" height="22" width="11" /></td>
<!-- Tab 4 End-->
<td><IMG height="22" src="images/spacer.gif" width="2"></td>
<!-- Tab 5 Begin-->
<td align="right"><img src="images/tabs/tab_blue_left.gif" id="TabControl_imgTab5a" height="22" width="11" /></td>
<td id="TabControl_tdTab5" nowrap="nowrap" align="center" width="100" background="images/tabs/tab_blue_bg.gif"><a id="TabControl_hlTab5" href="TktReports.aspx" style="color:DarkBlue;font-weight:bold;">Reports</a></td>

<td align="left"><img src="images/tabs/tab_blue_right.gif" id="TabControl_imgTab5b" height="22" width="11" /></td>
<!-- Tab 5 End-->
<td><IMG height="22" src="images/spacer.gif" width="2"></td>
</tr>
</table>
<!-- end tabs --></td>
</tr>
</table>
<!-- end banner + tab table
 
You might try
SendKeys "{Tab #}{Enter}"

#=the number of times to tab to reach the tab you want
worth a try.
 
link99sbc / Thanks for the response. I am struggling to the sendkeys to work. My script will
go to the site and login. I am still trying to navigate to another page on the site.
 
Found this in the Help Section

Using the EXTRA! Web Services Macro Generator tool, you can easily incorporate Web services into EXTRA! Basic macros. The Macro Generator produces a fully-coded, macro that is ready to run, which calls a user-specified Web service, sends it input, and assigns the output to macro variables. You can edit the generated macro code with the Macro Editor, and paste it into existing macros. For information on editing macros and the EXTRA! Basic macro language, see the EXTRA! Basic online Help.

The Macro Generator uses a URL that you supply, and lists the Web services, ports, and operations found at that location. You can view the parameters associated with a Web service operation by selecting that operation. From the Macro Generator window, you can provide a Web operation with input values, set parameters, and test your results. Once you are satisfied with the results, the Macro Generator produces macro code using the values you selected, and saves it as an EXTRA! Basic macro file with a filename you provide.

The EXTRA! Web Services Macro Generator contains the following:
Service Location (URL): Type the URL of a server running a Web service, or use the Browse button. The Macro Generator will search this location for all available Web services.
Connect: Choose this button to connect to the Web service at the location entered in the Service Location field.
Browse: Choose this button to search your computer and your network for a Web Service Description Language file. The URL of this file will appear in the Service Location (URL) field.

Web Service Information: Displays the Web services found at the specified URL, and the parameters of a selected Web service. Use the controls to set parameter values.
Services: Displays the Web services found at the specified URL in a tree format. Double-click a Web service to view its ports, and double-click a port to view its operations. Click an operation to view its parameters in the Parameters box.
Parameters: Displays information about a selected Web service operation in three columns:

The Parameter column displays the names of the parameters for the selected Web service.
The Type column shows the parameter's data type, such as string or double. The Type column also indicates whether a parameter is input-only, output-only, or input/output. When called, a Web service accepts or returns a value for each parameter, depending on its type.

Type Action
input-only A value must be assigned to this parameter before calling the Web service.
output-only The Web service returns a value for this parameter if data is available.
input/output A value may be assigned to this parameter if desired, but is not required. The Web service returns a value for this parameter if data is available.
The Value column displays the value assigned to a parameter. The values of output parameters and input/output parameters may vary depending on the values given for input parameters. You can assign values to input and input/output parameters using the controls below the Parameters box.

Parameter Value: After clicking a parameter name, you can assign it a value in this field. Click the Set button to set the value.
Set: Changes the value of the selected parameter to the value entered in the Parameter Value field.
Test Operation: Calls the selected Web service, supplies the input values listed in the Parameters box, and then displays the resulting values in the Parameters box.
Generate Macro: Creates new macro code to call the selected Web service, supplying the input values displayed in the Parameters box, and storing the returned output values in variables.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top