Jump to content

IUIAutomation MS framework automate chrome, FF, IE, ....


junkew
 Share

Recommended Posts

example 33 calculator and notepad

 

write below to uia.cfg

; Write below to uia.cfg file
; This is an inifile for UIA wrappers having the configuration defaults
; Debug=true        Turn debugging on of off with true/false value
; Highlight=true    Turn Highlighting rectangle to true / false
; TODO: AutoStartSUT=true AutoStartSUT is starting all SUT's automatically

[Global]
Debug=true
Highlight=true
AutoStartSUT=true

[Multiuser]
CFGPerUser=false

[Folders]
subfolders=false

;System under test settings
; Folder      = Location where exe can be found
; Workingdir  = Location of the working directory
; exe         = Name of the exe to start
; Fullname    = Path & name of exe
; Windowstate = minimized, maximized, normal


[SUT1]
Folder=%Windowsdir%\system32
Workingdir=%Windowsdir%\system32
exe=calc.exe
Fullname=%Windowsdir%\system32\calc.exe
Parameters=
Processname=calc.exe
Windowstate=normal

[SUT2]
Folder=%Windowsdir%\system32
Workingdir=%Windowsdir%\system32
exe=notepad.exe
Fullname=%Windowsdir%\system32\notepad.exe
Parameters=
Processname=notepad.exe
Windowstate=normal
Put below in new script
  • uncomment _UIA_startup lines
  • comment shellexecute lines
;~ *** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)



;~ Start the system under test applications
;~ _UIA_StartSUT("SUT1") ;~Calculator
;~ _UIA_StartSUT("SUT2") ;~Notepad

shellexecute("calc.exe")
shellexecute("notepad.exe")

;~ Low level setting of references
_UIA_SETVAR("calc.mainwindow","Title:=((Rekenmachine.*)|(calc.*));controltype:=UIA_WindowControlTypeId;class:=CalcFrame")
_UIA_SETVAR("btn1","title:=1;classname:=Button")
_UIA_SETVAR("btn2","title:=2;classname:=Button")
_UIA_SETVAR("btn3","title:=3;classname:=Button")
_UIA_SETVAR("btn4","title:=4;classname:=Button")
_UIA_SETVAR("btn5","title:=5;classname:=Button")
_UIA_SETVAR("btn6","title:=6;classname:=Button")
_UIA_SETVAR("btn7","title:=7;classname:=Button")
_UIA_SETVAR("btn8","title:=8;classname:=Button")
_UIA_SETVAR("btn9","title:=9;classname:=Button")
_UIA_SETVAR("btn+","automationid:=93;classname:=Button") 
_UIA_SETVAR("btn=","automationid:=121;classname:=Button") 
_UIA_SETVAR("mnuEdit","title:=((Edit)|(Bewerken));ControlType:=MenuItem") 
_UIA_SETVAR("mnuCopy","title:=((Copy.*)|(Kopi.*)); controltype:=MenuItem") ;~ Alternative way of setting the predefined references 
;- They are all prefixed with the reference Notepad. when loaded 
local $UID_NOTEPAD[4][2] = [ _ 
["mainwindow","classname:=Notepad"], _
 ["title","controltype:=50037"], _ 
["mnuEdit","name:=((Edit)|(Bewerken))"], _ 
["mnuPaste","name:=((Paste.*)|(Plak.*))"] _
 ] 

_UIA_setVarsFromArray($UID_NOTEPAD,"Notepad.") ;- Above could also be stored in configuration files 

;- Actual simple script ;- The bookkeeper has a calculator to make a calculation of 1 + 1 and he expects to see the answer 2 in notepad 

_UIA_Action("calc.mainwindow","setfocus") 
_UIA_Action("btn1","click") 
_UIA_Action("btn+","click") _UIA_Action("btn1","click") _UIA_Action("btn=","click") 
_UIA_Action("mnuEdit","click") 
_UIA_Action("mnuCopy","click") 
_UIA_Action("Notepad.mainwindow","setfocus") 
_UIA_Action("Notepad.mnuEdit","click") 
;~_uia_getvars2array() 
_UIA_Action("Notepad.mnuPaste","click")
Edited by junkew
Link to comment
Share on other sites

  • 2 weeks later...

@Junkew

Thank you for all your work.

I finally got it working.

I can get to a field, copy paste, and all that good stuff.

The only thing is that my code is really ugly.

And because i use the "Standard code" , it takes a while to focus on the approriate field because it goes from top to down.

Here is the code 

*** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP5=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=IUIAutomation MS framework automate chrome, FF, IE, .... - Page 16 - Example Scripts - AutoIt F - Windows Internet Explorer;controltype:=UIA_WindowControlTypeId;class:=IEFrame", $treescope_children)    
_UIA_Action($oP5,"setfocus")
Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Frame Tab", $treescope_children)    
_UIA_Action($oP4,"setfocus")
Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=IUIAutomation MS framework automate chrome, FF, IE, .... - Page 16 - Example Scripts - AutoIt F - Windows Internet Explorer;controltype:=UIA_PaneControlTypeId;class:=TabWindowClass", $treescope_children)    
_UIA_Action($oP3,"setfocus")
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Shell DocObject View", $treescope_children) 
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/page-16;controltype:=UIA_PaneControlTypeId;class:=Internet Explorer_Server", $treescope_children)  
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=IUIAutomation MS framework automate chrome, FF, IE, .... - Page 16 - Example Scripts - AutoIt Forums;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children) 
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll("Search.mainwindow", "title:=Search;ControlType:=UIA_EditControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Search;ControlType:=UIA_EditControlTypeId", $treescope_subtree)
_UIA_action($oUIElement,"click")

How do get this shorter?

Is there a way that I can skip all the treescope children and directly click on the field that I want?

Link to comment
Share on other sites

You could rewrite it to something like this (not tested)

and yes you could omit a lot of setfocus and setvar things but probably miss a lot of speed then

*** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_Setvar("myWindow.mainwindow","Title:=IUIAutomation MS framework automate.*;class:=IEFrame")
_UIA_Setvar("myWindow.pane","Title:=;controltype:=Pane;class:=Frame Tab")
_UIA_Setvar("myWindow.pane2","Title:=IUIAutomation MS framework automate.*;controltype:=Pane;class:=TabWindowClass")
_UIA_Setvar("myWindow.pane3","Title:=;controltype:=Pane;class:=Shell DocObject View")
_UIA_Setvar("myWindow.pane4","Title:=.*153520.*;controltype:=Pane;class:=Internet Explorer_Server")
_UIA_Setvar("myWindow.search","title:=Search;ControlType:=Edit")

;Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=IUIAutomation MS framework automate chrome, FF, IE, .... - Page 16 - Example Scripts - AutoIt Forums;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children) 


_UIA_Action("myWindow.mainwindow","setfocus")
_UIA_Action("myWindow.pane","setfocus")
_UIA_Action("myWindow.pane2","setfocus")
_UIA_Action("myWindow.pane3","setfocus")
_UIA_Action("myWindow.pane4","setfocus")
_UIA_Action("myWindow.search","click")
Edited by junkew
Link to comment
Share on other sites

  • 2 weeks later...

Hi Junkew, I am new to Autoit and UIAWrappers so apologies if this has been already answered, but I have searched the forum and I could not find a solution to my problem.
 
I have made the script below which works great (THANK YOU) but now I would like to turn off the red highlight rectangle and the debug xml file.

I have changed the UIA.CFG but it does not seem to work, I always get the highlight and xml file every time I run my script.

What I am doing wrong? Many thanks for your help and your great work.

##########  UIA.CFG ##########

; This is an inifile for UIA wrappers having the configuration defaults
; Debug=true        Turn debugging on of off with true/false value
; Highlight=true    Turn Highlighting rectangle to true / false
; TODO: AutoStartSUT=true AutoStartSUT is starting all SUT's automatically

[Global]
Debug=false
Highlight=false
AutoStartSUT=true

[Multiuser]
CFGPerUser=false

[Folders]
subfolders=false

#include "UIAWrappers.au3"

#AutoIt3Wrapper_UseX64=Y  ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os

Const $cToolbarByName = "name:=Google Chrome Toolbar"
Const $cAddressBarByName = "name:=Address and search bar"
Const $cChromeNewTabByName = "name:=New Tab"

$oChrome = _UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Raspbmc HOW-TO Posts - Google Chrome;class:=Chrome_WidgetWin_1", $treescope_children)
$oChrome.setfocus()
$oChromeToolbar = _UIA_getFirstObjectOfElement($oChrome, "name:=Google Chrome Toolbar", $treescope_subtree)
$oChromeAddressBar = _UIA_getObjectByFindAll($oChromeToolbar, "name:=Address and search bar", $treescope_subtree)

If Not IsObj($oChromeAddressbar) Then
    _UIA_DumpThemAll($oChromeToolbar, $treescope_subtree)
    Exit
EndIf

$oValueP=_UIA_getpattern($oChromeAddressBar,$UIA_ValuePatternId)

sleep(50)

;~  get the value of the addressbar
$myText=""
$oValueP.CurrentValue($myText)
consolewrite("address: " & $myText & @CRLF)
Link to comment
Share on other sites

probably an issue in

Func _UIA_LoadConfiguration()

Func _UIA_loadCFGFile($strFname)

You can workaround it with below settings in your script

;~  Some settings to use as a default
_UIA_setVar("Global.Debug", False)
_UIA_setVar("Global.Debug.File", False)
_UIA_setVar("Global.Highlight", False)
Link to comment
Share on other sites

Thanks for the workaround suggestion which worked for the for the Global.Highlight setting. However, the debug xml file was still created every time.

After some testing I discovered that the xml file is created even if you just have a script with only the include for UIAWrappers.au3 without any other code.

#include "UIAWrappers.au3"
Exit

So I checked the code of UIAWrappers.au3 and discovered that

func _UIA_TFW_Init()

creates the xml file without first trying to load CFG file or check the value of Global.Debug and Global.Debug.File

func _UIA_TFW_Init()

    OnAutoItExitRegister("_UIA_TFW_Close")

;~  Dictionary object to store a lot of handy global data
    $UIA_Vars = ObjCreate("Scripting.Dictionary")
    $UIA_Vars.comparemode = 2 ; Text comparison case insensitive

;~ Log each time to a new logyyyymmddhhmmssms.XML file
    _UIA_LogFile(@YEAR & @MON & @MDAY & "-" & @HOUR & @MIN & @SEC & @MSEC & ".XML" , true)

;~ Check if We can find configuration from file(s)
    _UIA_LoadConfiguration()

    $UIA_Vars.add("DESKTOP", $UIA_oDesktop)

    _UIA_VersionInfo()

    return seterror($_UIASTATUS_Success,0,0)
EndFunc

So I changed the code for func _UIA_TFW_Init() as below

func _UIA_TFW_Init()

    OnAutoItExitRegister("_UIA_TFW_Close")

;~  Dictionary object to store a lot of handy global data
    $UIA_Vars = ObjCreate("Scripting.Dictionary")
    $UIA_Vars.comparemode = 2 ; Text comparison case insensitive


;~ Check if We can find configuration from file(s)
    _UIA_LoadConfiguration()

    $UIA_Vars.add("DESKTOP", $UIA_oDesktop)

    _UIA_VersionInfo()


;~ Log each time to a new logyyyymmddhhmmssms.XML file
    If _UIA_getVar("Global.Debug.File") = True Then
        _UIA_LogFile(@YEAR & @MON & @MDAY & "-" & @HOUR & @MIN & @SEC & @MSEC & ".XML" , true)
    EndIf

    return seterror($_UIASTATUS_Success,0,0)
EndFunc

func _UIA_TFW_Close()
    _UIA_logfileclose()
EndFunc

This way I was able to load first the UIA.CFG, so I modified it as below but even after this change the xml file was created:

[Global]
Debug=false
Debug.File=false
Highlight=false

Moreover, after removing from my script the lines you have suggested as a workaround, I was once again getting the red highlight rectangle.

So after some research I found that because the Boolean values are written to and read from the UIA.CFG file then in AutoIt a Boolean String that is not blank is evaluated as TRUE and that explains why the settings in the UIA.CFG don't work (more details about Boolean Logic Confusion in AutoIt: '?do=embed' frameborder='0' data-embedContent>>)

As a final workaround I deleted the UIA.CFG file, removed in my script the lines from your workaround and instead I modified the

Func _UIA_LoadConfiguration()

in UIAWrappers.au3 to set to False the default values: Global.Debug, Global.Debug.File, Global.Highlight

Func _UIA_LoadConfiguration()

    _UIA_setVar("RTI.ACTIONCOUNT", 0)

;~  Some settings to use as a default
    _UIA_setVar("Global.Debug", False)
    _UIA_setVar("Global.Debug.File", False)
    _UIA_setVar("Global.Highlight", False)

;~  Check if we can find a configuration file and load it from that file
    If FileExists($UIA_CFGFileName) Then
        _UIA_loadCFGFile($UIA_CFGFileName)

    EndIf
;~      _UIA_LOG("Script name " & stringinstr(@scriptname),  $UIA_Log_Wrapper)
EndFunc   ;==>_UIA_LoadConfiguration

Probably this is not a very elegant solution but for now it works :D

Hopefully this can help other people having the same issue.

Link to comment
Share on other sites

actually its fixed in this way regarding the log.xml not getting created

func _UIA_LogFile($strName="log.xml", $reset=false)
    If _UIA_getVar("global.debug.file") = True Then

        if $reset=true Then
            $__g_hFileLog=fileopen($strName, $FO_OVERWRITE + $FO_UTF8)

            filewrite($__g_hFileLog,"<?xml version=""1.0"" encoding=""UTF-8""?>")
            filewrite($__g_hFileLog,"<log space=""preserve"">")

    ;~      filewrite($__g_hFileLog,"<!DOCTYPE html><html><body>")
    ;~      filewrite($__g_hFileLog,"<h1>UIA logging</h1>")
        Else
            $__g_hFileLog=fileopen($strName,$FO_APPEND + $FO_UTF8)
        EndIf
    EndIf
EndFunc
func _UIA_LogFileClose()
    If _UIA_getVar("global.debug.file") = True Then
    ;~  filewrite($__g_hFileLog,"</body></html>")
        filewrite($__g_hFileLog,"</log>" & @CRLF)
        fileclose($__g_hFileLog)
    EndIf
EndFunc

and regarding the true/false logic in my system it works when i reconfigure thru UIA.CFG (should be in same folder as your script)

$strVal = StringReplace($strVal, "%windowsdir%", @WindowsDir)
                    $strVal = StringReplace($strVal, "%programfilesdir%", @ProgramFilesDir)

;~                  _UIA_LOG("Key: [" & $strKey & "] Value: [" &  $strVal & "]" & @CRLF, $UIA_Log_Wrapper)
                    consolewrite("Key: [" & $strKey & "] Value: [" &  $strVal & "]" & @CRLF)

                    _UIA_setVar($strKey, $strVal)
                Next

with that consolewrite statement and running just uiawrappers.au3 you get

 
Key: [Global.Debug] Value: [False]
Key: [Global.Highlight] Value: [False]
Key: [Global.AutoStartSUT] Value: [False]
 
this looks to me valid autoItSyntax
If StringLower($strVal) = "true" Then $strVal = True
compare a string with a string and set than the value to the boolean true value (although you could argue I should not reuse $strVal itself)
 
edit: however isbool(_UIA_getVar("Global.Highlight") gives 0 and will lead to incorrect results if compared like this
 
If (_UIA_getVar("Global.Highlight") = True) Then
consolewrite("its h value" & isstring(_UIA_getVar("Global.Highlight")) & isbool(_UIA_getVar("Global.Highlight"))  & (_UIA_getVar("Global.Highlight") =true ) & (_UIA_getVar("Global.Highlight") ="False" ) & @CRLF)
_UIA_Highlight($UIA_oUIElement)
EndIf

apparently when adding to datadictionary string and booleans get mixed up

Edited by junkew
Link to comment
Share on other sites

Yes, regarding strings and booleans, it seems there is a mix up when loading the settings from the UIA.CFG into the dictionary .

I have changed the Func _UIA_loadCFGFile($strFname) and with my lines I get:

Before

Is Global.Debug boolean? 1
Is Global.Debug.File boolean? 1
Is Global.Highlight boolean? 1

After

Is Global.Debug boolean? 0
Is Global.Debug.File boolean? 0
Is Global.Highlight boolean? 0

Func _UIA_loadCFGFile($strFname)
    ConsoleWrite ("Is Global.Debug boolean? " & IsBool (_UIA_getVar("Global.Debug")) & @CRLF)
    ConsoleWrite ("Is Global.Debug.File boolean? " & IsBool (_UIA_getVar("Global.Debug.File")) & @CRLF)
    ConsoleWrite ("Is Global.Highlight boolean? " & IsBool (_UIA_getVar("Global.Highlight")) & @CRLF)

    Local $var
    Local $sections, $values, $strKey, $strVal, $i, $j

    $sections = IniReadSectionNames($strFname)

    If @error Then
        _UIA_LOG("Error occurred on reading " & $strFname & @CRLF, $UIA_Log_Wrapper)
    Else
;~      Load all settings into the dictionary
        For $i = 1 To $sections[0]
            $values = IniReadSection($strFname, $sections[$i])
            If @error Then
                _UIA_LOG("Error occurred on reading " & $strFname & @CRLF, $UIA_Log_Wrapper)
            Else
;~      Load all settings into the dictionary
                For $j = 1 To $values[0][0]
                    $strKey = $sections[$i] & "." & $values[$j][0]
                    $strVal = $values[$j][1]

                    If StringLower($strVal) = "true" Then $strVal = True
                    If StringLower($strVal) = "false" Then $strVal = False
                    If StringLower($strVal) = "on" Then $strVal = True
                    If StringLower($strVal) = "off" Then $strVal = False

                    If StringLower($strVal) = "minimized" Then $strVal = @SW_MINIMIZE
                    If StringLower($strVal) = "maximized" Then $strVal = @SW_MAXIMIZE
                    If StringLower($strVal) = "normal" Then $strVal = @SW_RESTORE

                    $strVal = StringReplace($strVal, "%windowsdir%", @WindowsDir)
                    $strVal = StringReplace($strVal, "%programfilesdir%", @ProgramFilesDir)

;~                  _UIA_LOG("Key: [" & $strKey & "] Value: [" &  $strVal & "]" & @CRLF, $UIA_Log_Wrapper)
                    consolewrite("Key: [" & $strKey & "] Value: [" &  $strVal & "]" & @CRLF)

                    _UIA_setVar($strKey, $strVal)
                Next
            EndIf
        Next
    EndIf
    ConsoleWrite ("Is Global.Debug boolean? " & IsBool (_UIA_getVar("Global.Debug")) & @CRLF)
    ConsoleWrite ("Is Global.Debug.File boolean? " & IsBool (_UIA_getVar("Global.Debug.File")) & @CRLF)
    ConsoleWrite ("Is Global.Highlight boolean? " & IsBool (_UIA_getVar("Global.Highlight")) & @CRLF)
EndFunc   ;==>_UIA_loadCFGFile
Edited by etabeta888
Link to comment
Share on other sites

I can launch chrome and redirect to a site fine but I am not able to detect certain doms I would like to change via script. How can I accomplish this in chrome? I would like to change the value of a text input field and click the submit button. I this possible using autoit?

Thanks!

Link to comment
Share on other sites

type in chrome (or other browser) addressbar:

javascript:alert(document.body.innerText);void(0);

you then have your script scrape that alertbox and after that you press okbutton.

little more subtle then a msgbox

javascript: var textbox = 
document.createElement('input');textbox.type = 
'text';document.body.appendChild(textbox);textbox.value=document.body.innerText;void(0);

if more questions on this subject please start a thread in support section as I can imagine this is a little more advanced especially for starters 

Link to comment
Share on other sites

is there any manual to use commands. took days to seek "how to click a button inside chrome html page" and get input value.

 

how to do it?

 

ah. same question. above

 is this the only clue?

name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl+F 

 

nope, i guess it is time to upgrade IE and use real browser wrapper for au3, this UI concept too complex for easy use..

Link to comment
Share on other sites

Please tell me how to make it easier.

Simplespy gives example Code. What you ask is in the examples.

Now you seem to have the knowledge what should i put in first post for starters?

 

how to click a button inside chrome html page

1. start chrome

2. type in your addressbar chrome://accessibility/

3. make sure global accessibility is turned on

4. start simplespy

5. hover over your button of interest and press ctrl+w

6. copy paste the code given in scite and press f5

;~ *** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP2=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=IUIAutomation MS framework automate chrome, FF, IE, .... - Page 16 - Example Scripts - AutoIt Forums - Google Chrome;controltype:=UIA_WindowControlTypeId;class:=Chrome_WidgetWin_1", $treescope_children)    
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=IUIAutomation MS framework automate chrome, FF, IE, .... - Page 16 - Example Scripts - AutoIt Forums;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND", $treescope_children)  
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children)   
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll("SaveChanges.mainwindow", "title:=Save Changes;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Save Changes;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
_UIA_action($oUIElement,"click")
7. understand the code and cleanup to your personal coding style

 
;~ *** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_SetVAR("MyChromeTab","Title:=IUIAutomation MS framework.*;controltype:=Document;class:=Chrome_RenderWidgetHostHWND")
_UIA_SetVAR("MyButton","title:=Save Changes;ControlType:=Button")

_UIA_Action("MyChromeTab","setfocus")
_UIA_Action("MyButton","click")

Exit
 

or even shorter

8. without intermediary variables

;~ *** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_Action("Title:=IUIAutomation MS framework.*;controltype:=Document;class:=Chrome_RenderWidgetHostHWND","setfocus")
_UIA_Action("title:=Save Changes;ControlType:=Button","click")

Exit
9. Whenever people feel there is a need to explain what click and setfocus means let me know Edited by junkew
Link to comment
Share on other sites

wow, thx junkew, never thought spy would do all stuff byself. 

i will utilize this, hope i can manage to get input texts and all actions.

#cs
* The actions provided so far
* "click", "doubleclick", "leftclick", "leftdoubleclick", "rightclick", "rightdoubleclick", "middleclick", "middledoubleclick",
* "mousemove", "movemouse", "left", "leftdouble", "right", "rightdouble", "middle", "middledouble"
* "setvalue", "setvalue using keys", "settextvalue", "getvalue"
* "sendkeys", "enterstring", "type", "typetext"
* "invoke", "focus", "setfocus", "activate", "close", "minimize", "maximize", "normal", "close", "exist", "exists", "move", "setposition", "resize"
* "searchcontext", "context", "highlight", "getobject","object", "attach"
* "capture","screenshot", dump", "dumpthemall"
#ce
Link to comment
Share on other sites

@AnAlien:
Difference with selenium

  • is that this UDF and AutoIT together can handle much more then selenium as selenium handles only the browser html but cannot automate the Windows stuff.
  • with autoit you can compile to a standalone executable (no runtimes needed etc)
  • tooling of selenium is maybe more userfriendly
  • Documentation of this UDF is so far only this thread where selenium has a little more documentation
  • With this UDF you can get information from HTML DOM but thats a little more hidden then SELENIUM support gives
  • Locating of elements is easier in this UDF than selenium (although that can be a matter of preference)
  • selenese commands can all be handled with the commands provided in this udf
    open                                          opens a page using a URL.
    click/clickAndWait                    performs a click operation, and optionally waits for a new page to load.
    verifyTitle/assertTitle                  verifies an expected page title.
    verifyTextPresent                       verifies expected text is somewhere on the page.
    verifyElementPresent                 verifies an expected UI element, as defined by its HTML tag, is present on the page.
    verifyText                                    verifies expected text and its corresponding HTML tag are present on the page.
    verifyTable                                  verifies a table’s expected contents.
    waitForPageToLoad                   pauses execution until an expected new page loads. Called automatically when clickAndWait is used.
    waitForElementPresent              pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.

@GuiltyKing: I will work on a version of simplespy that gives the 3 different ways of writing the source:
Shortest version               could be slower as the internal framework searches dynamically (normally not an issue as nowadays processors are very fast)

Maintainable version,       matter of style but logical and technical naming I prefer to have split

Flexible version                when you need more then setfocus, click you will need source like this

Edited by junkew
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

I have see the many example in the first page but nothing like this, maybe is not possible. If possible to get the filepath of a item ( just a ConsoleWrite, nothing else ) in a explorer folder simply hovering on it, without select/click the item?

Thanks for any example ;)

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Link to comment
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
 Share

×
×
  • Create New...