zreo15 Posted June 13, 2015 Share Posted June 13, 2015 (edited) well i tried the examples of iuiautomation and i keep on gettin errors on starting example ex2- "C:\Users\1406378\Downloads\EXAMPLES_V0_5\ex2_Taskbar.au3" (42) : ==> Variable must be of type "Object".:$oInvokeP.invoke()$oInvokeP^ ERRORex3-"C:\Users\1406378\Downloads\EXAMPLES_V0_5\UIAWrappers.au3" (1726) : ==> Variable must be of type "Object".:$t = $obj.Findfirst($treeScope, $oCondition, $UIA_pUIElement)$t = $obj^ ERRORex4 theres a missing endif i guess thats maybe editing error ex5-"C:\Users\1406378\Downloads\EXAMPLES_V0_5\UIAWrappers.au3" (1726) : ==> Variable must be of type "Object".:$t = $obj.Findfirst($treeScope, $oCondition, $UIA_pUIElement)$t = $obj^ ERRORex6-Action 1Action 2"C:\Users\1406378\Downloads\EXAMPLES_V0_5\UIAWrappers.au3" (1464) : ==> Variable must be of type "Object".:$oElementStart.FindAll($treeScope, $UIA_oTRUECondition, $pElements)$oElementStart^ ERRORex7-Action 7 retrieve document after clicking a hyperlinkAction 7 failed if firefox is already strted then it fails at action 6 only, the cursor goes to top-left corner n right clicks there then action fails , but if firefox is initially off then it fails at action 7ex8-Action 5"C:\Users\1406378\Downloads\EXAMPLES_V0_5\ex8_ie.au3" (121) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:_UIA_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2])_UIA_DrawRect($t[1],^ ERRORex-9/10-debug.au3 i cant find it on net where to download it from ex11(event)->Running AU3Check (3.3.12.0) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\1406378\Downloads\EXAMPLES_V0_5\Ex11Events.au3"C:\Users\1406378\Downloads\EXAMPLES_V0_5\Ex11Events.au3"(15,68) : warning: $objUIAutomation: possibly used before declaration.$hr=$objUIAutomation.AddFocusChangedEventHandler(0, $oFCEHandler())~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^"C:\Users\1406378\Downloads\EXAMPLES_V0_5\Ex11Events.au3"(40,28) : warning: $sIID_IUnknown: possibly used before declaration. Case $sIID_IUnknown,~~~~~~~~~~~~~~~~~~~~~~~~~~~^"C:\Users\1406378\Downloads\EXAMPLES_V0_5\Ex11Events.au3"(15,68) : error: $objUIAutomation: undeclared global variable.$hr=$objUIAutomation.AddFocusChangedEventHandler(0, $oFCEHandler())~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^"C:\Users\1406378\Downloads\EXAMPLES_V0_5\Ex11Events.au3"(40,28) : error: $sIID_IUnknown: undeclared global variable. Case $sIID_IUnknown,~~~~~~~~~~~~~~~~~~~~~~~~~~~^"C:\Users\1406378\Downloads\EXAMPLES_V0_5\Ex11Events.au3"(13,112) : error: UIA_ObjectFromTag(): undefined function.Global $oFCEHandler = UIA_ObjectFromTag("_MyHandler_", $dtagIUIAutomationFocusChangedEventHandler, $tFCEHandler)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^C:\Users\1406378\Downloads\EXAMPLES_V0_5\Ex11Events.au3 - 3 error(s), 2 warning(s)anyone have any idea why m I getting so many errors specially the " variable should be an object " Edited June 13, 2015 by zreo15 Link to comment Share on other sites More sharing options...
junkew Posted June 13, 2015 Share Posted June 13, 2015 Is the simple spy working? What os version? Normally with those errors something wrong with os FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
LarsJ Posted June 13, 2015 Share Posted June 13, 2015 zreo15, There are a few things that are good to know when you test the examples: junkew who has created the examples is Dutch and he has developed the examples on a Windows 7 64 bit PC.If you are not Dutch or is running another OS it can be necessary to change a few words or commands.First of all most of the text strings that are used to identify objects are localized and are case sensitive.Ex 2. I had to add these lines:case 0409 $CaptionStartButton="start"Ex 3 line 52: Replace $treescope_children with $TreeScope_DescendantsEx 5. Start Chrome manually. Copy and paste chrome://accessibility in the addressbar.Line 53: Replace $oChromeToolbar with $oChromeNow you can edit the rest of the examples yourself. If the problem persists then please refer to the line in the example that fails. You can find the line by inserting a couple of ConsoleWrite commands. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
zreo15 Posted June 13, 2015 Author Share Posted June 13, 2015 m running windows 8.1 64 bit english and yes simplespy is working fine no problem with it my accessibility is turned on and i had to change the paths for exe startup they are sumhow weird in my system and i did replace the dutch words ex2( after edit ) -Your languagecode influences name of start button and your languagecode is: 0409I bet you did not read the messagebox"C:\Users\1406378\Downloads\EXAMPLES_V0_5\ex2_Taskbar.au3" (42) : ==> Variable must be of type "Object".:$oStart.getCurrentPattern($UIA_InvokePatternId, $pInvoke)$oStart^ ERRORex3( after edit ) - Menu start foundscite not foundGet the pattern to click on the menu after the start button. Invoke possible: ** NO PROPERTYVALUE DUE TO NONEXISTING OBJECT **"C:\Users\1406378\Downloads\EXAMPLES_V0_5\UIAWrappers.au3" (514) : ==> Variable must be of type "Object".:$obj.getCurrentPattern($patternID, $pPattern)$obj^ ERROR been a year since i last updated my OS maybe thats why all the problem (( will update soon in a month when i go back to classes )) and will try to reinstall whole autoit again this time Link to comment Share on other sites More sharing options...
LarsJ Posted June 13, 2015 Share Posted June 13, 2015 You are on Windows 8.1. I have not used Windows 8/8.1. As far as I know the Start menu is replaced with a Start screen on Windows 8.1. That's the reason why it's not working. You probably have to change most of the code in Ex 2 to make it work with the Win 8.1 Start screen. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
zreo15 Posted June 13, 2015 Author Share Posted June 13, 2015 ah okay well what about the browser ones they should be working correctly i hope and i saw many times it happened that even though simplespy can get the details of the DOM elements correct but when the code is run its not accuratly performing it m guessing it maybe because of googles problems with chromes built system but even IE and firefox show same problemex i copy pasted code from simplespy of opening minimised firefox then i pasted the code of search button of speedialer page then when i ran the code it opened firefox properly then tried to find serch box but couldnt do it same result for chrome in another test i made them open a webpage and click on a few links on that page chrome kept on clicking on the same link everytym for each test n firefox kept on clickin on the firefox button sumhow other then browser automation everythin else is workin fine probably some fault in my system i guess Link to comment Share on other sites More sharing options...
junkew Posted June 13, 2015 Share Posted June 13, 2015 Difficult to say. As simple spy is recognizing everything can work as long as you can find out the proper elementtree. Thats the harder part and simplespy cannot fully help with that. I have stuff working for all browsers but have seen with especially chrome versions object hierarchy and classnames are changing. I am working on the iuiwrappers to get it more stable in finding objects. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
zreo15 Posted June 14, 2015 Author Share Posted June 14, 2015 yup well i went through that thread and read about the problem good luck with it and i will report the result after updating my os Link to comment Share on other sites More sharing options...
zreo15 Posted June 14, 2015 Author Share Posted June 14, 2015 yup well i went through that thread and read about the problem good luck with it and i will report the result after updating my os Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now