UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Click On A "tab" Using VBA, Any Versions    
 
   
dflak
post Apr 23 2018, 12:55 PM
Post#1


Utter Access VIP
Posts: 6,185
Joined: 22-June 04
From: North Carolina


Actually IE11.

Unfortunately, the site is proprietary, so I can't give an example. However, I do have code that works, that will log me in and brings up an Executive Summary Page, the top of which is shown in the picture.

This brings me up to my definition of "TAB" and the source of the problem. All my searches come up with discussion of additional "windows" to other URLs open in the same session of Explorer. That is not what I mean by tab. When the Executive Summary comes up, it has these "things" on top with names like Executive Summary, CLNR, Returns, etc. I want to click on the "thing" labeled Device Performance.

I think I extracted the appropriate part of the code from the Executive Summary Page. I need to tell VB to click on this "thing" for Device Performance. Note: I put line breaks in the code to make it readable.

CODE
saw.customlink.setCustomLinks();</script>
<script type="text/javascript">obips.BreadCrumbs.Manager.getSingleton().addToBreadCrumb('XXX Dashboard Home: Executive Summary', '/shared/BI Reports/_portal/XXX Dashboard Home', false, {"ViewState":"","page":"Executive Summary"});obips.BreadCrumbs.Manager.getSingleton().addPageUnloadHandler();</script>

<script type="text/javascript">var tabArray = [{name:"Executive Summary", caption:"Executive Summary", descript:""},
{name:"CLNR", caption:"CLNR", descript:""},
{name:"Returns", caption:"Returns", descript:""},
{name:"Triage", caption:"Triage", descript:""},
{name:"Shipping", caption:"Shipping", descript:""},
{name:"Returns Performance", caption:"Returns Performance", descript:""},
{name:"Device Quality", caption:"Device Quality", descript:""},
{name:"Device Performance", caption:"Device Performance", descript:""},
{name:"Sales", caption:"Sales", descript:""},
{name:"Edge Sales", caption:"Edge Sales", descript:"Sales data for Edge from the daily POS records provided by XXX"},
{name:"OEM", caption:"OEM", descript:""}, {name:"OEM Returns Performance", caption:"OEM Returns Performance", descript:""},
{name:"OEM Device Performance", caption:"OEM Device Performance", descript:""}];</script>

<link rel="stylesheet" href="res/s_blafp/b_mozilla_4/portalcontent.CSS" type="text/CSS">


Attached File(s)
Attached File  This_Tab.jpg ( 61.32K )Number of downloads: 15
 

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
EspressoWillie
post Apr 26 2018, 11:04 PM
Post#2



Posts: 75
Joined: 12-March 06
From: Redmond, WA


There are plenty of javascript or other scripting routines to produce tabs for a website. Plus other software too. Looks like you are using Oracle BI Interactive Dashboard. So if you view source, can you find the description in the source?
You don't show the extension of the webpage. What is it? I have a tab control on one of my clients, and I am using ASP.NET. So the webpage is https:// ...xx/xxx/xxx...aspx. You could execute the URL in the source that applies to the tab.
You could also get the location of the tab in pixels (I think - would have to find it). I have seen code to click a mouse in a particular location on a webpage. Try searching here first. I may have something in my archives, but will have to look around...
This post has been edited by EspressoWillie: Apr 26 2018, 11:05 PM

--------------------
Cheers!!

Willie McClure
www.datarim.com
Talk's cheap, takes money to buy whiskey.
Go to the top of the page
 
dflak
post May 2 2018, 11:01 AM
Post#3


Utter Access VIP
Posts: 6,185
Joined: 22-June 04
From: North Carolina


You are correct, this is an Oracle BI Interactive Dashboard application.

The URL for the Executive Summary is: https://xxxxx.yyyyy.com/analytics/saw.dll?Dashboard

I don't know if this will help, buy inspect element yields the code in the picture (sorry, I don't know how to copy/paste or save to file).



Attached File(s)
Attached File  Inspect_Element.jpg ( 28.5K )Number of downloads: 6
 

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
EspressoWillie
post May 4 2018, 02:43 AM
Post#4



Posts: 75
Joined: 12-March 06
From: Redmond, WA


I found some old code to do a mouse click at an X, Y location. What I haven't found is how to get the X, Y position easily. I will keep looking, but if you find a utility that would give you the mouse location where you click, that would do it. So here is the code. You would just call MoveAndClick(X, Y).
CODE
Type MouseCommand    ' INPUT structure
  iType As Long      ' 0 for mouse, 1 for kbd
  iDx As Long        ' rel movt in pixels (unless ABSOLUTE)
  iDy As Long
  iWheelData As Long ' we don't use this
  iFlags As Long     ' we use this (see MOUSEEVENT flags below)
  iTime As Long      ' don't use this
  iXtra As Long      ' or this
End Type

Const MOUSEEVENTF_LEFTDOWN = &H2 '  left button down
Const MOUSEEVENTF_LEFTUP = &H4 '  left button up
Declare Function SendInput Lib "user32" (ByVal nCommands As Long, iCommand As MouseCommand, ByVal cSize As Long) As Long
Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

Sub MoveAndClick(ByVal X As Long, ByVal Y As Long)
  ' move cursor to X, Y and simulate click
  On Error Resume Next
  Dim mCommand As MouseCommand

  SetCursorPos X, Y
  DoEvents
  
  With mCommand
    .iFlags = MOUSEEVENTF_LEFTDOWN
    SendInput 1&, mCommand, Len(mCommand)
    .iFlags = MOUSEEVENTF_LEFTUP
    SendInput 1&, mCommand, Len(mCommand)
  End With

End Sub

--------------------
Cheers!!

Willie McClure
www.datarim.com
Talk's cheap, takes money to buy whiskey.
Go to the top of the page
 
dflak
post May 8 2018, 09:33 AM
Post#5


Utter Access VIP
Posts: 6,185
Joined: 22-June 04
From: North Carolina


I'll check this out. What might be an issue is portability. Different screens: different resolutions. However, this is not the first time, I've had to find where an object is, but all those other times are with Excel.

This is not a crushing requirement on my part. I'm doing this for a co-worker and I've already told the powers at the top that they can buy a very basic QA tool for about 5K that will do this for them.

I've tried several options with the Tab key and such to see if I can select the tab. Then I can mimic the action with SENDKEYS (yuck, but it will work).

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
kippyboss
post Jun 28 2018, 05:23 PM
Post#6



Posts: 2
Joined: 28-June 18



QUOTE
I found some old code to do a mouse click at an X, Y location. What I haven't found is how to get the X, Y position easily


Same here. Oracle dashboards are usually like this.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    20th August 2018 - 06:55 PM