Sign in to follow this  
Followers 0
Gmaster123

Will AutoIT support UI

6 posts in this topic

I need some help on Autoscriptit tool. Here is my scenario.

Click the icon button on the IE toolbar.

Here the problem with this tool is that I am not able to specify the an object as an icon button, instead I have to script it using X,Y co-ordinates to detect where is the icon to click on it. So I specified ( X, Y) co-ordinates to click an icon on the IE toolbar. The co-ordination is working in my system, but when I run the same script on different machines my script is not able to detect the icon as the code is specified with x, y co-ordinates. My question is that can we do something to find the icon by the script and to work it fine or is there any other way to script as click on icon button. Please some one who faced or know about this issue help me

I am using mouse click for clicking the icon

MouseClick("Left", $size[2] - 189, 140)

MouseClick("left",$size[2] - 156,176)

Your comments will be appreciable.

Thanks in advance

Share this post


Link to post
Share on other sites



I need some help on Autoscriptit tool. Here is my scenario.

Click the icon button on the IE toolbar.

Here the problem with this tool is that I am not able to specify the an object as an icon button, instead I have to script it using X,Y co-ordinates to detect where is the icon to click on it. So I specified ( X, Y) co-ordinates to click an icon on the IE toolbar. The co-ordination is working in my system, but when I run the same script on different machines my script is not able to detect the icon as the code is specified with x, y co-ordinates. My question is that can we do something to find the icon by the script and to work it fine or is there any other way to script as click on icon button. Please some one who faced or know about this issue help me

I am using mouse click for clicking the icon

MouseClick("Left", $size[2] - 189, 140)

MouseClick("left",$size[2] - 156,176)

Your comments will be appreciable.

Thanks in advance

You could try using the AutoIt Window Info tool to see if you can get any info on the control and then use ControlClick on it.

BTW

This post belongs in the support forum not here.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

I need some help on Autoscriptit tool. Here is my scenario.

Click the icon button on the IE toolbar.

Here the problem with this tool is that I am not able to specify the an object as an icon button, instead I have to script it using X,Y co-ordinates to detect where is the icon to click on it. So I specified ( X, Y) co-ordinates to click an icon on the IE toolbar. The co-ordination is working in my system, but when I run the same script on different machines my script is not able to detect the icon as the code is specified with x, y co-ordinates. My question is that can we do something to find the icon by the script and to work it fine or is there any other way to script as click on icon button. Please some one who faced or know about this issue help me

I am using mouse click for clicking the icon

MouseClick("Left", $size[2] - 189, 140)

MouseClick("left",$size[2] - 156,176)

Your comments will be appreciable.

Thanks in advance

I think you want _IEAction() from IE.AU3 for full automation. You can get the UDF from: http://www.autoitscript.com/forum/index.php?showtopic=13398.

I think this is what you are asking for. If not an idea would be to make it so your script calibrates whenever it's launched.


[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Share this post


Link to post
Share on other sites

1. What is the 'icon button'? Are you talking about a specific button (Home, Back, Stop etc.), or any button in general in the IE toolbar?

2. Can you access the function through the menu system instead? In which case, what function is it?

3. Why aren't you using Firefox instead?


“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Share this post


Link to post
Share on other sites

1. What is the 'icon button'? Are you talking about a specific button (Home, Back, Stop etc.), or any button in general in the IE toolbar?

2. Can you access the function through the menu system instead? In which case, what function is it?

3. Why aren't you using Firefox instead?

Hi Stumpii,

1.Icon button was "Google web Accelerator". Once we install the Google web accelerator(http://webaccelerator.google.com), icon will be launch on the IE/FireFox right side on the top. Problem was occurring when icon is in different location on the IE/Firefox.

a. what would be the solution to recognized the Google web accelerator icon?

b. Currently in my script, I am using X,Y co-ordination to click on the icon. Is there any other way to write the script for identifying the icon?

2.Function:

#include <file.au3>

;;;;;;;;;;;;;;;;;;;;;;;;;;

; Main Program

;;;;;;;;;;;;;;;;;;;;;;;;;;

BrowserClose()

_FileWriteLog($LOG_FILE,"---------------------Main Program -----------------------")

_FileWriteLog($LOG_FILE,"TESTCASE: This is Basic Function ")

_FileWriteLog($LOG_FILE,"DETAIL: Testing using IE Browser ")

_FileWriteLog($LOG_FILE,"---------------------------------------------------------")

Run("C:\Program Files\Internet Explorer\iexplore.exe","",@SW_MAXIMIZE)

Sleep(1000)

WinSetState("Google - Microsoft Internet Explorer", "anything", @SW_MAXIMIZE)

;WinMove("Google - Microsoft Internet Explorer","", -4, -4, 1608, 1174)

$size = WinGetPos("")

_FileWriteLog($LOG_FILE,"----------------------Preferences-----------------------")

$GWA_Preference = Preferences()

_FileWriteLog($LOG_FILE,"--------------------------------------------------------")

_FileWriteLog($LOG_FILE,"----------------------Performance-----------------------")

$GWA_Performace = Performance()

_FileWriteLog($LOG_FILE,"--------------------------------------------------------")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;

;Browser close

;;;;;;;;;;;;;;;;;;;;;;;

Func BrowserClose()

; List Iexplore

$list = ProcessList("iexplore.exe")

for $i = 1 to $list[0][0]

; msgbox(0, $list[$i][0], $list[$i][1])

next

; List FireFox

$list1 = ProcessList("firefox.exe")

for $i = 1 to $list1[0][0]

;msgbox(0, $list1[$i][0], $list1[$i][1])

next

If ProcessExists("iexplore.exe") Then

ProcessClose("iexplore.exe")

ElseIf ProcessExists("firefox.exe") then

ProcessClose("firefox.exe")

EndIf

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Preferences

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

func Preferences()

;Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

;Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("Google - Microsoft Internet Explorer","Google")

If Not WinActive("Google - Microsoft Internet Explorer","Google") Then WinActivate("Google - Microsoft Internet Explorer","Google")

WinWaitActive("Google - Microsoft Internet Explorer","Google")

MouseClick("Left", $size[2] - 189, 140); click on GWA icon

MouseClick("left",$size[2] - 156,176) ; click on prefernce

;MouseMove(1084,79)

;MouseUp("left")

Sleep(1000)

$title = WinGetTitle("", "")

MsgBox(0,"title text", $title)

if $title = "Google Web Accelerator: Preferences - Microsoft Internet Explorer" Then

MsgBox(0,"Pass","Successful")

_FileWriteLog ($LOG_FILE, " PASS :--Preferences page is Displayed")

Else

MsgBox(0,"Fail","Not Successful")

_FileWriteLog ($LOG_FILE, " FAIL :-- Preferences Page is Not Displayed")

EndIf

;WinWait("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google")

;If Not WinActive("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google") Then WinActivate("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google")

WinWaitActive("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google")

MouseClick("left",184,63)

Sleep(1000)

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Preferences

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

func Preferences()

;Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

;Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("Google - Microsoft Internet Explorer","Google")

If Not WinActive("Google - Microsoft Internet Explorer","Google") Then WinActivate("Google - Microsoft Internet Explorer","Google")

WinWaitActive("Google - Microsoft Internet Explorer","Google")

MouseClick("Left", $size[2] - 189, 140); click on GWA icon

MouseClick("left",$size[2] - 156,176) ; click on prefernce

;MouseMove(1084,79)

;MouseUp("left")

Sleep(1000)

$title = WinGetTitle("", "")

MsgBox(0,"title text", $title)

if $title = "Google Web Accelerator: Preferences - Microsoft Internet Explorer" Then

MsgBox(0,"Pass","Successful")

_FileWriteLog ($LOG_FILE, " PASS :--Preferences page is Displayed")

Else

MsgBox(0,"Fail","Not Successful")

_FileWriteLog ($LOG_FILE, " FAIL :-- Preferences Page is Not Displayed")

EndIf

;WinWait("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google")

;If Not WinActive("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google") Then WinActivate("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google")

WinWaitActive("Google Web Accelerator: Preferences - Microsoft Internet Explorer","Google")

MouseClick("left",184,63)

Sleep(1000)

EndFunc

Share this post


Link to post
Share on other sites

The toolbar that the button sits in has a unique ControlID, but the button does not, so there is no way to simply click the button.

Looked a little into the code to do it via COM and it would be a real pain. IE does not provide access to the toolbars easily (like in Excel etc.) as they are COM objects themselves.

What you could try is using the ControlGetPos function on the toolbar object and then adding 10 to the x and y coords and clicking there. As the button is at the front, it should click the button whether the toolbar is. Make sure that the ControlID of the toolbar does not change between IE sessions though.

Sorry there does not appear to be a better way. :lmao:


“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0