Jump to content

Recommended Posts

Posted

I currently have a script that sends a specific number of tabs (on an IE screen) to position the cursor on a specific item in order to select it and "click " Enter. The script works fine if the item is the first in the list. However, if the item is not the first item on the list the wrong item is selected.

How can I search for the item by text and once it is found position the cursor on it and "click" Enter?

In the attached image I want to find the subject "1214/2011" which can be on any line in the display.

Thank you.

post-46148-0-59054400-1320700080_thumb.j

Posted

_IELinkClickByText() might possibly work for this. There are several other steps that must be followed before you can use this function though... for example _IECreate() or _IEAttach(), etc...

Posted

I tried the suggestion but it seems that the items in the list are not defined the way that _IELinkClickByText() expects them to be. Have to go back to the tab approach I was using and make it work that way.

Posted

I tried the suggestion but it seems that the items in the list are not defined the way that _IELinkClickByText() expects them to be.

Then check out the many other _IE* functions available...almost certain something will work...

Have to go back to the tab approach I was using and make it work that way.

If you want more specific help you'll need to provide the code you're attempting to use and if you can, a link to the page you're dealing with. If it requires login then maybe you can provide a test login or the name of the application and maybe we can find a demo login for it or something to try to help you out further. You can also try installing DebugBar which could give you more info about all the DOM elements...

Posted

I created a test login and I am including the script for you to see what I tried to do. I need to make sure that I get the latest report with the name "Productivity". I make sure that I get the latest report(s) sorted in descending order. However, there is no guarantee that another report was not run from the time the Productivity report was run and the automated retrieval takes place from the pc.

I tired using the _IELinkClickByText() command to make sure that I am positioned on the first occurrence (which is actually the latest copy because of the sort), but I do not get a response from the command.

Thanks for your help.

Download csv test.au3

Posted (edited)

So the table containing the links you want to click is within a frame, which is within another frame which is within yet another frame. I don't know of any other way to accomplish this so here it is...

This code is meant to be used immediately after logging in to the site.

#include 
#include 
$oIE = _IEAttach("Auto Test", "WindowTitle")
$oTheFrame = _IEFrameGetCollection($oIE, 5) ;Get the 6th frame of the main window (index = 5)
$oTheFrame2 = _IEFrameGetCollection($oTheFrame, 0)  ;Get the first frame within the last (index = 0)
$oTheFrame3 = _IEFrameGetCollection($oTheFrame2, 1)  ;Get the second frame within the last (index = 1)
$oTheTable = _IETableGetCollection($oTheFrame3, 0)  ;Get the first table in the innermost frame, $oTheFrame3
$aTableData = _IETableWriteToArray ($oTheTable)   ;Dump the table to an array
_ArrayDisplay($aTableData)      ;Show you what's in the array visually

The problem now is finding the most recent message and clicking it...unfortunately I'm out of time...

Edit: OK Another problem is the array only contains text, the obj references to the links aren't included so I had to gather them separately then figure out how they match up to the array contents. Hope that makes sense!

Edited by MrMitchell

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...