oracle sql语句优化 uodate 弄不弄了 在线等

如何在oracle的sqlplus中新建一个数据库?语句怎么写?我写了一个:create database test;但是不对。_百度知道
提问者采纳
oracle建立数据库需要很多信息,像日志文件。一般不建议直接sql敲,本身提供了dbca的自动建库工具了。开始--运行--dbca
建立数据库,就可以了
提问者评价
没有找到合适的,但还是谢谢你!
其他类似问题
已经有这个数据库了啊你的语法是正确的。
sqlplus的相关知识
按默认排序
其他1条回答
有些准备工作和参数是不能少的。参见百度文库:
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Javascript Disabled Detected
You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality.
IUIAutomation MS framework automate chrome, FF, IE, ....
Started by
Please log in to reply
323 replies to this topic
IntroductionWith this module you can automate all applications/programs that support ui automation and/or accesibility api from microsoftyou can recognize more controls than AutoIT can recognize "out of the box"&you can use concepts from other testing frameworks likeo&Some of those controls / applications arechrome browser&in the adress bar of chrome or start with "--force-renderer-accessibility"silverlight controlsRibbon controlcontrolbars of Excel/WordIE and FF browsersWindows Media PlayerWindows clockAFX .. controls (partly)....Based on the initial AIO Object I now have made the interface file to work with objCreateInterface function which is in the latest beta's&automate clicking and querying basic informationIt gives you a lot of basic information to be able to automate clicking, querying basic information where it goes further in certain situations than AutoIt is identifyingStarting threads for background on the ui automation api of microsoft (not for starters)Previous threads in general help/supportBe aware that API is not allways installed under XP/Vista see Within Windows 7 and Windows 8 it should be preinstalled by default. Be aware on 32 and 64 bits way of running your script#AutoIt3Wrapper_UseX64=Y or N&Basic example of usage / showing and retrieving the default information, will post multiple examples laterHover your mouse to an area of interest and press ctrl+w and information will be shown in the edit box of the formSimple spy demo (see simplespy.au3 or use latest ZIP &attachment for latest version)&Main featuresRecognize windows and html controls for the major browsersLogical and physical description for controls (UI mapping, Application map)Simple repository logic to abstract logical and physical descriptionsStore Runtime Type Information in RTI. variablesRubberbanding/highlighting of objectsSimple spy to help in making / identifying the physical descriptionSupport of regular expression(s) in identifying objectsrecognize objects on multiple propertiessupported properties:&name ,title, automationid, classname, class, iaccessiblevalue, iaccessiblechildId, controltype, processid, acceleratorkeyThe actions provided so far"leftclick", "left", "click", "leftdoubleclick", "leftdouble", "doubleclick", _"rightclick", "right", "rightdoubleclick", "rightdouble", _"middleclick", "middle", "middledoubleclick", "middledouble", "mousemove", "movemouse""setvalue","settextvalue""setvalue using keys""getvalue""sendkeys", "enterstring", "type", "typetext""invoke""focus", "setfocus", "activate""close""move","setposition""resize""minimize", "maximize", "normal", "close", "exist", "exists""searchcontext", "context""highlight""getobject","object""attach""capture","screenshot""dump", "dumpthemall"&match on multiple properties like:&name:=((Zoeken.*)|(Find.*)); ControlType:=B acceleratorkey:=Ctrl\+FSupport for 117 different properties see $UIA_propertiesSupportedArray in uiawrappers&like for exampletitle, regexptitle, class, regexpclass, iaccessiblevalue, iaccessiblechildid, name, accesskey, automationid, classname&IAccessible, IAccessible2, ISimpleDom interfaces&debuglogging to a file log.txt (no output in scitewindow)Examples.....TODOBuild recorderEnhance the spy with a nicer UIUI for the repository (now in the script with dot notation)Enhance mapping / identifying on multiple properties instead of 1 combined with indexIf speed becomes an issue use the caching logic of the MS UIA frameworkAdd the other patterns laterGeneralize the concept of System Under Test of starting the SUT (for testing framework purposes)Remote running of scripts...edit august 18th 2013 &initial postOnly zip files are needed to download , just unzip in 1 directory&edit september 15th 2014see more details in UIA_Changelog.txtmore cleanup to be in UDF styleMore comments in the sourceLogging in XML file instead of flat file so easier to retransform later with XSLT tooling in nicely reporting formatsversion 0.5 (regression tested against examples)new simplespy.au3 in UIA_V0_51.ZIPedit2 september 15th 2014small glitch in uiawrappers.au3 fixed
Attached Files
& &&38.79KB
&&1050 downloads
& &&56.23KB
&&896 downloads
& &&41.49KB
&&563 downloads
& &&59.88KB
&&371 downloads
Edited by junkew, 21 September 2014 - 12:38 PM.
ok got it going on my old xp machine ..... now for more examples
Quickstart&
Start simplespy.au3
Hover your mouse over the element you want to handle
Press ctrl+w
Copy / paste the given source to a new AutoIT script
If you need help
ask for help in new thread in general support section and post
screenshot that shows your element is highlighted with simplespy
post output of simplespy with all properties
attached log.txt if available in your script directory
use allways contents of latest zip files which could be work in progress (WIP) zip
As you will not come far if you do not understand the basics first do thisUnderstand AutoIT
Understand testing frameworks and related concepts
If you understand above learn the basic way of setting focus and clicking thru UIA and the wrappers
&Understand IUIAutomation wrappers and framework
Lets do the QuickStart steps as described above on the Start Button of Windows
You will get this
*** Standard code ***
&UIAWrappers.au3&
(&MustDeclareVars&, 1)
$oP0=_UIA_getObjectByFindAll($UIA_oDesktop, &Title:=;controltype:=UIA_PaneControlTypeId;class:=Shell_TrayWnd&, $treescope_children) &
_UIA_Action($oP0,&setfocus&)
_UIA_setVar(&Starten.mainwindow&,&title:=Sclassname:=Button&)
_UIA_action(&Starten.mainwindow&,&setfocus&)
This code is not yet perfect (and simplespy will improve over time) and you will have to change still manually
_UIA_setVar is only used to get a "logical" name for a technical description
There are many ways for UIA which varies from simple thru the wrappers to advanced based on the CUIAutomation2.au3
This is better coded
&UIAWrappers.au3&
(&MustDeclareVars&, 1)
_UIA_setVar(&RTI.SEARCHCONTEXT&, $UIA_oDesktop)
$oP0=_UIA_action(&Title:=;controltype:=UIA_PaneControlTypeId;class:=Shell_TrayWnd&, &getobject&)
_UIA_Action($oP0,&move&)
_UIA_action(&title:=Sclassname:=Bcontroltype:=UIA_ButtonControlTypeId&,&move&)
_UIA_action(&title:=Sclassname:=Bcontroltype:=UIA_ButtonControlTypeId&,&invoke&)
;~ _UIA_action(&title:=Start.*;classname:=Binstance:=2&,&move&)
;~ _UIA_action(&title:=Start.*;classname:=Binstance:=2&,&invoke&)
Learn first to automate some simple stuff on notepad.exe and calc.exe by starting those applications and with ctrl+w within simplespy try some code snippets
See for latest examplecode the zip in first post
Example 1&Iterating thru the different ways of representing the objects in the tree
a. Autoit WinList function
b. UIAutomation RawViewWalker
c. UIAutomation ControlViewWalker
d. UIAutomation ContentViewWalker
e. Finding elements based on conditions (based on property id, frequently search on name or classname)
AutoIt & & & &expandcollapse& popup &EditConstants.au3&
&GUIConstantsEx.au3&
&WindowsConstants.au3&
&WinAPI.au3&
&CUIAutomation2.au3&
&UIAWrappers.au3&
;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os
$var = ()
$var[0][0]
& & ; Only display visble windows
$var[$i][0] && &&
IsVisible($var[$i][1])
& & & & ( &Title=& & $var[$i][0] && & & &Handle=& & $var[$i][1] &
IsVisible($handle)
(($handle), 2)
& ;==&IsVisible
sampleTW(1)
sampleTW(2)
sampleTW(3)
(&**** Desktop windows ****& & )
findThemAll($oDesktop, $TreeScope_Children)
(&**** All childs of the taskbar ****&)
$oTaskBar=_UIA_gettaskbar()
findThemAll($otaskbar,$treescope_subtree)
sampleTW($t)
& & (&initializing tw & & $t & )
;~ ' Lets show all the items of the desktop with a treewalker
$objUIAutomation.RawViewWalker($pTW)
$objUIAutomation.ControlViewWalker($pTW)
$objUIAutomation.ContentViewWalker($pTW)
& & $oTW=($pTW, $sIID_IUIAutomationTreeWalker, $dtagIUIAutomationTreeWalker)
($oTW) = 0
& & & & (1,&UI automation treewalker failed&, &UI Automation failed failed&,10)
& & $oTW.GetFirstChildElement($oDesktop, $pUIElement)
& & $oUIElement = ($pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)
($oUIElement)=
& & & & ( &Title is: & & &_UIA_getPropertyValue($oUIElement,$UIA_NamePropertyId) & & & &Handle=& & (_UIA_getPropertyValue($oUIElement, $UIA_NativeWindowHandlePropertyId)) & &
& &Class=& & _UIA_getPropertyValue($oUIElement,$uia_classnamepropertyid) & )
& & & & $oTW.GetNextSiblingElement($oUIElement,$pUIElement)
& & & & $oUIElement = ($pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)
findThemAll($oElementStart, $TreeScope)
;~ &Get result with findall function alternative could be the treewalker
$pCondition, $pTrueCondition
$pElements, $iLength
& & $objUIAutomation.CreateTrueCondition($pTrueCondition)
& & $oCondition=($pTrueCondition, $sIID_IUIAutomationCondition,$dtagIUIAutomationCondition)
;~ &$oCondition1 = _AutoItObject_WrapperCreate($aCall[1], $dtagIUIAutomationCondition)
;~ Tricky to search all descendants on html objects or from desktop/root element
& & $oElementStart.FindAll($TreeScope, $oCondition, $pElements)
& & $oAutomationElementArray = ($pElements, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray)
& & $oAutomationElementArray.Length($iLength)
$iLength - 1; it's zero based
& & & & $oAutomationElementArray.GetElement($i, $pUIElement)
& & & & $oUIElement = ($pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)
& & & & ( &Title is: & & &_UIA_getPropertyValue($oUIElement,$UIA_NamePropertyId) & & & &Class=& & _UIA_getPropertyValue($oUIElement,$uia_classnamepropertyid) & )
edit 21 aug 2014
Added quick start stuff
Edited by junkew, 30 August 2014 - 09:27 PM.
junkew, nice job.& I remember discussing this stuff a long while back, as I had worked on the IAccessible interface (which is also included as a 'legacy' element in IUIAutomation)
I think I got discouraged with that project because there was just too much information returned. I should really have coded it to have a filter of some sort plus a 'search' method, but laziness or disinterest set in.
I remember you had a treeview type of interface showing the IUI elements under the mouse, right?& That would have been a great start for a 'next-gen' Window Info tool.
My contributions:
Wrappers/Modifications of others' contributions:
UDF's added support/programming to:
(original code: eynstyne)
(All personal code/wrappers centrally located at )
G'day Junkew
There is so much that the Windows API can't access and it's long overdue that UIautomation was brought into AutoIt.
I second Ascend4nt's comment about a "next-gen" Window info tool.& It'd be a great tool to explore this new way of Automating Windows.
What I've always liked to see in the existing info tool is code samples to cut and paste.& In other words you select an item click a button and get a bit of code to cut and paste into your program.
I've got many ideas about it that I won't expand on here unless you're interested.
I'm not just asking for something as always I'm willing to help out in any way I can if you need any help.
As you're the current expert
how hard would it be to convert help file examples using standard syntax to UIautomation examples?
Thanks for the effort!
John Morrison
Some of my small contributions to AutoIt
John Morrison aka Storm-E
Simple scripts
The whole thread is having a history and more or less started with the complex scripts and over time more abstraction was put in UIAWrappers.au3 to make life easier. So the higher numbered examples are for starters easier to start with. This post just to give some quick reference to those examples and an advicable way to learn your way around.
&For starters its adviceable to start just with
1. calculator and notepad example over
2. desktop and taskbar examples
3. combine above
4. continue your steps with simple forms in IE browsers
5. continue with other browsers like chrome and firefox
6. Opera browser(s) is less open for automation
7. Deal with tables / grids
8. Deal with tables / grids in three different browsers&
9. testing framework with logging and configuration
10. The whole iuiautomation framework of microsoft
&Further comments
Feel free to contribute or add items on a TODO list
My first priority is to share the basic examples and make a minimal library to make life easier for startes on this UI Automation object
Its a powerfull model but you have to start coding to learn the basics
@Ascend4nt: First post is already having a "spy" use your mouse and click or use ctrl+m all detailed properties will show up in the edit box
In general I use inspect.exe out of the windows SDK which gives me all the details so not much priority from my side to make it in a treeview format@storne: & & & &I don't think it will make sense to make functions like _UIA_ControlSetFocus(.....) as UIA goes in some areas far from the logic of AutoIT so hard to map.
I will add some basic examples feel free to have certain requests or try your own
Many examples are on google for example to move an element/window:&
Created UIAWrappers.AU3 and attached to first post
Example 2 Finding the taskbar and clicking on the start menu button
AutoIt & & & &expandcollapse& popup &EditConstants.au3&
&GUIConstantsEx.au3&
&WindowsConstants.au3&
&WinAPI.au3&
&CUIAutomation2.au3&
&UIAWrappers.au3&
;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os
(&**** All childs of the taskbar ****& & )
$oTaskBar=_UIA_gettaskbar()
_UIA_DumpThemAll($otaskbar,$treescope_subtree)
$pInvoke, $oStart
(&**** try to click on the start button of the taskbar ****& & )
;~ Get the first item that has as the name: Starten change to Start for english or other text to match start button in local language
$oStart=_UIA_getFirstObjectOfElement($oTaskbar,&Starten&, $treescope_subtree)
($oStart)
& & (&Start button found&)
& & (&I bet the text has to change to Start instead of Starten&)
;~ Get the invoke pattern to click on the item
$oStart.getCurrentPattern($UIA_InvokePatternId, $pInvoke)
$oInvokeP=($pInvoke, $sIID_IUIAutomationInvokePattern, $dtagIUIAutomationInvokePattern)
$oInvokeP.invoke()
Edited by junkew, 21 September 2014 - 12:39 PM.
Example works great for me.
Pretty cool stuff this junkew, and you were correct with this&"I bet the text has to change to Start instead of Starten"
&OMG! Women are the cows of people.
This shows a little more on the concept of1. Find your element2. Think what you want and find the right pattern3. Retrieve the pattern and execute the action&Within the patterns you will find not likely direct support for clicking right mouse and default actions are not allways what you want so then you have to fallback to mousemove, mouseclick functions of autoit or the sendinput function from microsoft (not declared in the standard autoit library)&updated UIAWrappers.AU3 with some additional helper functions to get below working&Example 3 Clicking a litlle more and in the end displaying all items from the clock (thats not directly possible with AU3Info)AutoIt & & & &expandcollapse& popup &EditConstants.au3&
&GUIConstantsEx.au3&
&WindowsConstants.au3&
&constants.au3&
&WinAPI.au3&
&CUIAutomation2.au3&
&UIAWrappers.au3&
;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os
(&**** Get the taskbar ****& & )
$oTaskBar=_UIA_gettaskbar()
;~ Equal To
;~ _UIA_getFirstObjectOfElement($oDesktop,&classname:=Shell_TrayWnd&,$TreeScope_Children)
(&**** All childs of the taskbar ****& & )
;~ &_UIA_dumpThemAll($otaskbar,$treescope_subtree)
$pInvoke ;~ Pattern invoke
$oStart &;~ Object reference to IUIElement for button start
(&**** Different ways of assigning the startbutton to an object ****& & )
;~ $oStart=_UIA_getFirstObjectOfElement($oTaskbar,&Starten&, $treescope_subtree)
$oStart=_UIA_getFirstObjectOfElement($oTaskbar,&name:=Starten&, $treescope_subtree)
$oClock &;~ Object reference to IUIElement for button of clock, be aware this is a panel not a button
$oClock=_UIA_getFirstObjectOfElement($oTaskbar,&classname:=TrayClockWClass&, $treescope_subtree)
(&**** try to click on the start button of the taskbar ****& & )
;~ Get the first item that has as the name: Starten change to Start for english or other text to match start button in local language
$oStart=_UIA_getFirstObjectOfElement($oTaskbar,&Starten&, $treescope_subtree)
($oStart)
& & (&Start button found&)
& & (&I bet the text has to change to Start instead of Starten&)
(&Get the invoke pattern to click on the start button item. Invoke possible: & & _UIA_getPropertyValue($oUIElement, $UIA_IsInvokePatternAvailablePropertyId) & )
;~ $oStart.getCurrentPattern($UIA_InvokePatternId, $pInvoke)
;~ $oInvokeP=objCreateInterface($pInvoke, $sIID_IUIAutomationInvokePattern, $dtagIUIAutomationInvokePattern)
$oInvokeP=_UIA_getpattern($oStart,$UIA_InvokePatternID)
$oInvokeP.invoke()
(100)
(&Get the menu that is after the start button& & )
$oMenuStart=_UIA_getFirstObjectOfElement($oDesktop,&Menu Start&, $treescope_children)
($oMenuStart)
& & (&Menu start found& & )
& & (&I bet the text has to change to Start instead of Starten& & )
$oStartMenuItem
$oStartMenuItem=_UIA_getFirstObjectOfElement($oMenuStart,&name:=SciTE Script Editor&, $treescope_subtree)
;~ $oStartMenuItem=_UIA_getFirstObjectOfElement($oMenuStart,&Microsoft Excel 2010&, $treescope_subtree)
;~ $oStartMenuItem=_UIA_getFirstObjectOfElement($oMenuStart,&SpotGrit&, $treescope_subtree)
($oStartMenuItem)
& & (&Scite found& & )
& & (&scite not found& & )
(&Get the pattern to click on the menu after the start button. Invoke possible: & & _UIA_getPropertyValue($oStartMenuItem, $UIA_IsInvokePatternAvailablePropertyId) & )
$oInvokeP=_UIA_getpattern($oStartMenuItem,$UIA_InvokePatternID)
;~ This would definitely fail as there is no invoke pattern
($oInvokeP)
& & (&invoke found lets see what happens& & )
& & (&invoke not supported& & )
$oInvokeP.invoke()
(2000)
(&So you saw it selected but did not click& & )
;~ still you can click as you now know the dimensions where to click
$t=(_UIA_getPropertyValue($oStartMenuItem, $UIA_BoundingRectanglePropertyId),&;&)
($t[1] & &;& & $t[2] & &;& & $t[3] & &;& & $t[4] & )
;~ _winapi_mouse_event($MOUSEEVENTF_ABSOLUTE + $MOUSEEVENTF_MOVE,$t[1],$t[2])
($t[1]+($t[3]/2),$t[2]+$t[4]/2)
(&left&)
(2000)
(&**** try to click on the clock (TrayClockWClass) button of the taskbar ****& & )
($oClock)
& & (&Clock found& & )
& & (&Clock not found& & )
;~ $oClock.getCurrentPattern($UIA_InvokePatternId, $pInvoke)
$oLegacyP=_UIA_getPattern($oClock,$UIA_LegacyIAccessiblePatternId)
$oLegacyP.dodefaultaction()
$oClock2=_UIA_getFirstObjectOfElement($odesktop,&classname:=ClockFlyoutWindow&,$TreeScope_Children)
_UIA_dumpthemall($oClock2,$treescope_subtree)
Edited by junkew, 05 November 2013 - 10:47 PM.
New example 4&that demonstrates on the calculatorHow to clickHow to find buttons (be aware that you have to change the captions to language of your windows)How to click in the menu (copy result to the clipboard)then it uses notepad to demonstrateHow to set a value on a textbox with the value patternUpdated first post with latest uiawrappers.au3&Attention pointsExamples are build on exact match of text (so this includes tab and Ctrl+C values), later I will make some function that can find with regexp or non exact match (need treewalker for that)Timing / sleep is sometimes needed to give the system time to popup the menus / execute the actionFocus of application is sometimes to be set (and sometimes not as you look on the clicking of the buttons it will even happen when there is a screen in front of the calculator)AutoIt & & & &expandcollapse& popup &EditConstants.au3&
&GUIConstantsEx.au3&
&WindowsConstants.au3&
&constants.au3&
&WinAPI.au3&
&debug.au3&
&CUIAutomation2.au3&
&UIAWrappers.au3&
;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os
(&calc.exe&)
(&notepad.exe&)
$oCalc=_UIA_getFirstObjectOfElement($oDesktop,&class:=CalcFrame&, $treescope_children)
$oNotepad=_UIA_getFirstObjectOfElement($oDesktop,&class:=Notepad&, $treescope_children)
($oCalc)
;~ You can comment this out just there to get the names of whats available under the calc window
_UIA_DumpThemAll($oCalc,$treescope_subtree)
& & $sText=&1&
& & $oButton=_UIA_getFirstObjectOfElement($oCalc,&name:=& & $sText, $treescope_subtree)
& & $oInvokeP=_UIA_getpattern($oButton,$UIA_InvokePatternID)
& & $oInvokeP.Invoke
& & $sText=&Optellen& & ;Add
& & $oButton=_UIA_getFirstObjectOfElement($oCalc,&name:=& & $sText, $treescope_subtree)
& & $oInvokeP=_UIA_getpattern($oButton,$UIA_InvokePatternID)
& & $oInvokeP.Invoke
& & $sText=&3&
& & $oButton=_UIA_getFirstObjectOfElement($oCalc,&name:=& & $sText, $treescope_subtree)
& & $oInvokeP=_UIA_getpattern($oButton,$UIA_InvokePatternID)
& & $oInvokeP.Invoke
& & $sText=&Is gelijk aan& & &;Is equal to
& & $oButton=_UIA_getFirstObjectOfElement($oCalc,&name:=& & $sText, $treescope_subtree)
& & $oInvokeP=_UIA_getpattern($oButton,$UIA_InvokePatternID)
& & $oInvokeP.Invoke
& & $sText=&Bewerken& & &;Edit
& & $oButton=_UIA_getFirstObjectOfElement($oCalc,&name:=& & $sText, $treescope_subtree)
& & $oInvokeP=_UIA_getpattern($oButton,$UIA_InvokePatternID)
& & $oInvokeP.Invoke
& & (1500)
;~ &findThemAll($oCalc,$treescope_subtree)
;~ &sleep(1000)
;~ Use a regular expression to identify the copy choice as there are special characters/tabs etc in the name
& & $sText=&Kopi?ren.*& & &;Copy
& & $oButton=_UIA_getObjectByFindAll($oCalc,&name:=& & $sText, $treescope_subtree)
($oButton)
& & & & (&Menuitem is there&)
& & & & (&Menuitem is NOT there&)
& & (1000)
& & $oInvokeP=_UIA_getpattern($oButton,$UIA_InvokePatternID)
& & $oInvokeP.Invoke
& & (500)
($oNotepad)
$myText=()
;~ You can comment this out
_UIA_dumpThemAll($oNotepad,$treescope_subtree)
& & (1000)
& & $oNotepad.setfocus()
& & $sText=&Edit&
& & $oEdit=_UIA_getFirstObjectOfElement($oNotepad,&classname:=& & $sText, $treescope_subtree)
& & $oValueP=_UIA_getpattern($oEdit,$UIA_ValuePatternId)
& & $oValueP.SetValue($myText)
Edited by junkew, 05 November 2013 - 10:57 PM.
This example shows how to use UI Automation with chrome (later an example will come to put stuff in the html page)1. Have chrome started&with "--force-renderer-accessibility"2. Check with &in the adress bar if accessibility is on/off, turn it ona. or close all browsers and change in script the run command to the right path of the chrome.exe&Apparently google changed some stuff in chrome version 29 and seems not allways to return classname properly so sometimes harder to get the right element&&Example 5 Automating chromeAutoIt & & & &expandcollapse& popup &EditConstants.au3&
&GUIConstantsEx.au3&
&WindowsConstants.au3&
&constants.au3&
&WinAPI.au3&
&debug.au3&
&CUIAutomation2.au3&
&UIAWrappers.au3&
;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os
$strChromeExeFolder= & &\AppData\Local\Google\Chrome\Application\&
$strChromeStartup=&--force-renderer-accessibility&
$strChromeExe=$strChromeExeFolder & &chrome.exe &
;~ Start chrome
($strChromeExe)
(&chrome.exe&)
& & & & ($strChromeExe & $strChromeStartup,&&,
& & & & (&chrome.exe&)
& & & & ;~ Just to give some time to start
& & & & (10000)
& & (&No clue where to find chrome on your system, please start manually:& &
& & ($strChromeExe & $strChromeStartup & )
$oChrome=_UIA_getFirstObjectOfElement($oDesktop,&class:=Chrome_WidgetWin_1&, $treescope_children)
$oChrome.setfocus()
;~ _UIA_DumpThemAll($oDesktop,$treescope_children)
($oChrome)
;~ &_UIA_DumpThemAll($oChrome,$treescope_children)
;~ &get the toolbar
;~ &$oChromeToolbar=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_ToolBarControlTypeId, $treescope_subtree)
$oChromeToolbar=_UIA_getFirstObjectOfElement($oChrome,&name:=Google Chrome Toolbar& , $treescope_subtree)
;~ &_UIA_DumpThemAll($oChromeToolbar,$treescope_subtree)
;~ &get the addressbar
;~ &$oChromeAddressBar=_UIA_getFirstObjectOfElement($oChrome,&class:=Chrome_OmniboxView&, $treescope_children) ;worked in chrome 28
$oChromeAddressBar=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_EditControlTypeId , $treescope_subtree) ;works in chrome 29
;~ &$oChromeAddressBar=_UIA_getFirstObjectOfElement($oChrome,&name:=Adres- en zoekbalk& &, $treescope_children) ;works in chrome 29
;~ &_UIA_DumpThemAll($oChromeToolbar,$treescope_children)
$oValueP=_UIA_getpattern($oChromeAddressBar,$UIA_ValuePatternId)
;~ &get the value of the addressbar
$myText=&&
$oValueP.CurrentValue($myText)
(&address: & & $myText & )
;~ Click all tabs
$oChromeTabs=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_TabControlTypeId, $treescope_subtree)
;~ &_UIA_DumpThemall($oChromeTabs,$treescope_children)
;~ &Get result with findall function alternative could be the treewalker
$pCondition, $pTrueCondition
$pElements, $iLength
& & $objUIAutomation.CreateTrueCondition($pTrueCondition)
& & $oCondition=($pTrueCondition, $sIID_IUIAutomationCondition,$dtagIUIAutomationCondition)
& & $oChromeTabs.FindAll($treescope_children, $oCondition, $pElements)
& & $oAutomationElementArray = ($pElements, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray)
& & $oAutomationElementArray.Length($iLength)
$iLength - 1; it's zero based
& & $oAutomationElementArray.GetElement($i, $pUIElement)
& & & & $oUIElement = ($pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)
& & & & ( &Title is: && & &_UIA_getPropertyValue($oUIElement,$UIA_NamePropertyId) & &&&& &
& && &Class & := && & _UIA_getPropertyValue($oUIElement,$uia_classnamepropertyid) & &&&& &
& &controltype:= && & &_UIA_getPropertyValue($oUIElement,$UIA_ControlTypePropertyId) & &&&& &
;~ &Invoke or select them all
;~ Tricky as chrome seems to say it supports certain patterns but then they seem not to be implemented
;~ only tabs with content
_UIA_getPropertyValue($oUIElement, $UIA_IsSelectionItemPatternAvailablePropertyId) = &True&
_UIA_action($oUIElement,&leftclick&)
;~ &$oSelectP=_UIA_getpattern($oUIElement,$UIA_SelectionItemPatternId)
;~ &$oSelectP.Select()
;~ Lets open a new tab within chrome
$oChromeNewTab=_UIA_getFirstObjectOfElement($oChromeTabs,&controltype:=& & $UIA_ButtonControlTypeId, $treescope_subtree)
_UIA_action($oUIElement,&leftclick&)
;~ Lets get the valuepattern of the addressbar
;~ &$oLegacyP=_UIA_getpattern($oChromeAddressBar,$UIA_LegacyIAccessiblePatternId)
_UIA_action($oUIElement,&leftclick&)
_UIA_action($oUIElement,&setvalue using keys&,&/{ENTER}&)
Edited by junkew, 05 November 2013 - 11:11 PM.
I can't run that last example. Apparently some function definition is missing.Is there anything special I need to do except having that script together with two includes in the same folder?
Edited by trancexx, 29 August 2013 - 01:31 PM.
.:oOOOOo:.
.:oOOOOo:.
.:oOO:'':Oo:. .:oO:'':OOo:.
OT9AO0IEDrk
':oO. .Oo:'
'o' :kiss:
Interesting.
@TranceXX: Just uploaded latest UIAWrappers.AU3 maybe I missed to do that. If you still get an error let me know
Special things that sometimes is needed (hopefully I can manage this in the UIAWrappers.AU3 later)
Open once chrome is started the url&chrome://accessibility/&to see if accessibility is on
Chrome version 29 as Google is still changing classnames, names of properties etc. its not allways the same to find an object
A terrible workaround is needed for html input text boxes as their name is determined by the value (seems to be specified that way by W3C) and not on the name or id attribute (only picks attribut aria-label when its available)
Start chrome manually or remove commented run statement for starting chrome (not handling multiple instances of chrome at the moment)
OS Language can influence stuff (I am on a dutch OS so sometimes names have to be set in english so then I sometimes switch to find by one of the other properties)
If stuff is not working use the findThemAll(&handle to object&, &treescope&) it will write the childs with the most common properties to the output window
Be aware on treescope_subtree as if it walks to the leafs of the hierarchy it can take minutes especially if multiple HTML windows are open
$oChrome=_UIA_getFirstObjectOfElement($oDesktop,&class:=Chrome_WidgetWin_1&, $treescope_children)
findThemAll($oDesktop,$treescope_children)
I have frequently inspect.exe open on my desktop to validate what properties are available and what values are there
For the IAccessible2 interface (not yet as I have not converted the IDL to the autoit syntax) I use AccProbe
Below some background for TODO later
Chrome supports following interfaces under Windows:
MSAA/IAccessible (complete)
IAccessible2 (mostly complete)
ISimpleDOM (mostly complete)
IAccessibleEx and UI Automation (very limited)
@TranceXX: I should be able to get to the IAccessible2 interface by making a call to QueryInterface as Chrome supports below interfaces but I am a little less experienced in this interface/com stuff so maybe you can help out
accProbe will show what IAccessible2 can reveal out of an html page (first register the needed proxy dll)
a. IAccessible2.IDL needs to be converted to Autoit syntax
b. This should be written in AutoIT syntax
& & HWND hw = GetForegroundWindow();
& & IAccessible *pIA;
& & HRESULT hr = AccessibleObjectFromWindow(hw, OBJID_CLIENT, IID_IAccessible, (void**)&pIA);
& & if (!SUCCEEDED(hr))
& & & & return -1;
& & const IID IID_IAccessible2 = {0xE89F726E, 0xC4F4, 0x4c19, 0xbb, 0x19, 0xb6, 0x47, 0xd7, 0xfa, 0x84, 0x78};
& & ::IServiceProvider *pService = NULL;
& & hr = pIA-&QueryInterface(IID_IServiceProvider, (void **)&pService);
& & if(SUCCEEDED(hr))
& & {
& & & & IAccessible2 *pIA2 = NULL;
& & & & hr = pService-&QueryService(IID_IAccessible2, IID_IAccessible2, (void**)&pIA2);
& & & & if (SUCCEEDED(hr) && pIA2)
& & & & {
& & & & & & pIA2-&Release();
& & & & }
& & & & pService-&Release();
& & } &
That code written in AutoIt would be something like this (interfaces definitions missing):AutoIt & & & &expandcollapse& popup
$hOLEACC_DLL = (&oleacc.dll&)
$OBJID_CLIENT = 0xFFFFFFFC
YourCodeWrittenInAutoIt($hWindow)
$tIID_IAccessible = ($sIID_IAccessible)
$pIAccessible = AccessibleObjectFromWindow($hWindow, $OBJID_CLIENT, $tIID_IAccessible)
& & ; Object from pointer
$oIAccessible = ($pIAccessible, $sIID_IAccessible, $tagIAccessible)
$pIServiceProvider
& & $oIAccessible.QueryInterface($sIID_IServiceProvider, $pIServiceProvider)
& & ; Again object from pointer
$oIServiceProvider = ($pIServiceProvider, $sIID_IServiceProvider, $tagIServiceProvider)
& & $oIServiceProvider.QueryService($IID_IAccessible2, $IID_IAccessible2, $pIA2)
& & ; And again creating object from pointer
$oIA2 = ($pIA2, $sIID_IAccessible2, $tagIAccessible2)
AccessibleObjectFromWindow($hWindow, $iObjId, $tRefIID)
$aCall = ($hOLEACC_DLL, &long&, &AccessibleObjectFromWindow&, &hwnd&, $hWindow, &dword&, $iObjId, &struct*&, $tRefIID, &ptr*&, )
$aCall[0] & 0
(1, 0, 0)
$aCall[4]
If you look closely at that (and your) code you will see call to oIAccessible.QueryInterface(...). That probably means that you can skip one step and specify $tIID_IServiceProvider directly in earlier call to AccessibleObjectFromWindow to get $pIServiceProvider pointer directly.
Edited by trancexx, 29 August 2013 - 07:39 PM.
.:oOOOOo:.
.:oOOOOo:.
.:oOO:'':Oo:. .:oO:'':OOo:.
OT9AO0IEDrk
':oO. .Oo:'
'o' :kiss:
From the uiautomation framework I can get to $oIaccessible by doing below code
The AccessibleObjectFromWindow is the MSAA way of getting the interface but thx again for the example as this will help later on getting to IAccessible2 or ISimpleDom
& & $oLegacyP=_UIA_getpattern($oUIElement,$UIA_LegacyIAccessiblePatternId)
& & $oIAccessible = $oLegacyP.GetIAccessible()
Example 6 Demonstrates all stuff within chrome to navigate html pages, find hyperlink, click hyperlink, find picture, click picture, enter data in inputboxUodate UIAWrappers.AU3Made a lot more comments and failure to show when an object is not retrieved/found the hierarchy of the tree is written to the consoleLots of optimizations could be done by using the cachefunctions (less interprocess communication) but on my machine it runs at a very acceptable speedIn top of script put the text in your local language of the operating systemAutoIt & & & &expandcollapse& popup &EditConstants.au3&
&GUIConstantsEx.au3&
&WindowsConstants.au3&
&constants.au3&
&WinAPI.au3&
&debug.au3&
&CUIAutomation2.au3&
&UIAWrappers.au3&
;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os
;~ Make this language specific
$cToolbarByName = &name:=Google Chrome Toolbar&
$cAddressBarByName = &name:=Adres- en zoekbalk&
$cChromeNewTabByName=&name:=Nieuw tabblad&
$strChromeExeFolder= & &\AppData\Local\Google\Chrome\Application\&
$strChromeStartup=&--force-renderer-accessibility&
$strChromeExe=$strChromeExeFolder & &chrome.exe &
;~ Start chrome
($strChromeExe)
(&chrome.exe&)
& & & & ($strChromeExe & $strChromeStartup,&&,
& & & & (&chrome.exe&)
& & & & ;~ Just to give some time to start
& & & & (10000)
& & (&No clue where to find chrome on your system, please start manually:& &
& & ($strChromeExe & $strChromeStartup & )
;~ Find the chrome window
$oChrome=_UIA_getFirstObjectOfElement($oDesktop,&class:=Chrome_WidgetWin_1&, $treescope_children)
($oChrome)
& & _UIA_DumpThemAll($oDesktop,$treescope_children)
;~ Make sure chrome is front window
$oChrome.setfocus()
($oChrome)
& & (&Action 1& & )
;~ &get the chrome toolbar
;~ &$oChromeToolbar=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_ToolBarControlTypeId, $treescope_subtree)
& & $oChromeToolbar=_UIA_getFirstObjectOfElement($oChrome,$cToolbarByName, $treescope_subtree)
($oChromeToolbar)
& & & & _UIA_DumpThemAll($oChrome,$treescope_subtree)
(&Action 2& & )
;~ &get the addressbar
;~ &$oChromeAddressBar=_UIA_getFirstObjectOfElement($oChromeToolbar,&class:=Chrome_OmniboxView&, $treescope_children) ;worked in chrome 28
;~ &$oChromeAddressBar=_UIA_getFirstObjectOfElement($oChromeToolbar,&controltype:=& & $UIA_EditControlTypeId , $treescope_subtree) ;works in chrome 29
;~ &$oChromeAddressBar=_UIA_getFirstObjectOfElement($oChromeToolbar,&name:=Adres- en zoekbalk& &, $treescope_children) ;works in chrome 29
& & $oChromeAddressBar=_UIA_getObjectByFindAll($oChromeToolbar, $cAddressBarByName &, $treescope_subtree) ;works in chrome 29
($oChromeAddressbar)
& & & & _UIA_DumpThemAll($oChromeToolbar,$treescope_subtree)
;~ &$oValueP=_UIA_getpattern($oChromeAddressBar,$UIA_ValuePatternId)
;~ &sleep(2000)
;~ &get the value of the addressbar
;~ &$myText=&&
;~ &$oValueP.CurrentValue($myText)
;~ &consolewrite(&address: & & $myText & @CRLF)
(&Action 3& & )
;~ Get reference to the tabs
& & $oChromeTabs=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_TabControlTypeId, $treescope_subtree)
($oChromeTabs)
& & & & _UIA_DumpThemAll($oChrome,$treescope_subtree)
;~ Lets open a new tab within chrome
(&Action 4& & )
;~ &$oChromeNewTab= _UIA_getFirstObjectOfElement($oChromeTabs,&controltype:=& & $UIA_ButtonControlTypeId, $treescope_subtree)
& & $oChromeNewTab= _UIA_getObjectByFindAll($oChromeTabs, $cChromeNewTabByName,$treescope_subtree)
($oChromeNewTab)
& & & & _UIA_DumpThemAll($oChromeTabs,$treescope_subtree)
& & _UIA_action($oChromeNewtab,&leftclick&)
& & (500)
(&Action 4a& & )
$oChromeAddressBar=_UIA_getObjectByFindAll($oChromeToolbar, $cAddressBarByName &, $treescope_subtree) ;works in chrome 29
($oChromeAddressbar)
_UIA_DumpThemAll($oChromeToolbar,$treescope_subtree)
$t=(_UIA_getPropertyValue($oChromeAddressBar, $UIA_BoundingRectanglePropertyId),&;&)
_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2])
_UIA_action($oChromeAddressBar,&leftclick&)
(&Action 4b& & )
;~ give some time to open website
(2000)
$oDocument=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_DocumentControlTypeId , $treescope_subtree)
($oDocument)
_UIA_DumpThemAll($oChrome,$treescope_subtree)
$t=(_UIA_getPropertyValue($oDocument, $UIA_BoundingRectanglePropertyId),&;&)
_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2])
(500)
(&Action 4c retrieve document after clicking a hyperlink& & )
$oForumLink=_UIA_getObjectByFindAll($oDocument,&name:=On&, $treescope_subtree)
($oForumLink)
(&*** Scripting will fail as accessibility is off ****&)
(4096, &Accessibility warning&, &Accessibility is turned off, put it on by clicking on Off after Global accessibility mode&, 10)
_UIA_DumpThemAll($oDocument,$treescope_subtree)
(&Action 4d& & )
;~ $oChromeNewTab= _UIA_getFirstObjectOfElement($oChromeTabs,&controltype:=& & $UIA_ButtonControlTypeId, $treescope_subtree)
$oChromeNewTab= _UIA_getObjectByFindAll($oChromeTabs, $cChromeNewTabByName,$treescope_subtree)
($oChromeNewTab)
_UIA_DumpThemAll($oChromeTabs,$treescope_subtree)
_UIA_action($oChromeNewtab,&leftclick&)
(500)
(&Action 5& & )
$oChromeAddressBar=_UIA_getObjectByFindAll($oChromeToolbar, $cAddressBarByName , $treescope_subtree) ;works in chrome 29
($oChromeAddressbar)
_UIA_DumpThemAll($oChromeToolbar,$treescope_subtree)
$t=(_UIA_getPropertyValue($oChromeAddressBar, $UIA_BoundingRectanglePropertyId),&;&)
_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2])
_UIA_action($oChromeAddressBar,&leftclick&)
_UIA_action($oChromeAddressBar,&setvalue using keys&,&/{ENTER}&)
(&Action 6& & ) ;~ give some time to open website
(2000)
$oDocument=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_DocumentControlTypeId , $treescope_subtree)
($oDocument)
_UIA_DumpThemAll($oChrome,$treescope_subtree)
$t=(_UIA_getPropertyValue($oDocument, $UIA_BoundingRectanglePropertyId),&;&)
_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2])
(500)
(&Action 7 retrieve document after clicking a hyperlink& & )
$oForumLink=_UIA_getObjectByFindAll($oDocument,&name:=Forum&, $treescope_subtree)
($oForumLink)
_UIA_DumpThemAll($oDocument,$treescope_subtree)
_UIA_action($oForumLink,&invoke&)
(3000)
(&Action 8 first refresh the document control& & )
$oDocument=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_DocumentControlTypeId , $treescope_subtree)
($oDocument)
_UIA_DumpThemAll($oChrome,$treescope_subtree)
$t=(_UIA_getPropertyValue($oDocument, $UIA_BoundingRectanglePropertyId),&;&)
_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2])
;~ Now we get the searchfield
$oEdtSearchForum=_UIA_getObjectByFindAll($oDocument,&name:=Search...&, $treescope_subtree)
($oEdtSearchForum)
_UIA_DumpThemAll($oDocument,$treescope_subtree)
_UIA_action($oEdtSearchForum,&focus&)
_UIA_action($oEdtSearchForum,&setvalue using keys&,&Chrome can easy be automated with ui automation&) ; {ENTER}&)
(500)
;~ Now we press the button, see relative syntax used as the button seems not to have a name its just 2 objects further then search field
$oBtnSearch=_UIA_getObjectByFindAll($oDocument,&name:=Search...; indexrelative:=2&, $treescope_subtree)
($oBtnSearch)
_UIA_DumpThemAll($oDocument,$treescope_subtree)
$t=(_UIA_getPropertyValue($oDocument, $UIA_BoundingRectanglePropertyId),&;&)
_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2])
(1000)
_UIA_action($oBtnSearch,&invoke&)
(2000)
;~ consolewrite(&Action 9 first refresh the document control& & @CRLF)
$oDocument=_UIA_getFirstObjectOfElement($oChrome,&controltype:=& & $UIA_DocumentControlTypeId , $treescope_subtree)
($oDocument)
_UIA_DumpThemAll($oDocument,$treescope_subtree)
$oHyperlink=_UIA_getObjectByFindAll($oDocument,&name:=controlsend doesn't work&, $treescope_subtree)
($oBtnSearch)
_UIA_DumpThemAll($oDocument,$treescope_subtree)
(1000)
_UIA_action($oHyperlink,&invoke&)
(2000)
&&&edit 1 sept 2013: added steps 4a,b,c,d to warn for accessibility is off
Edited by junkew, 17 November 2013 - 11:10 PM.
Capitally!
Yes! This two includes in one line is typo.
I have Example5.working nice after replacement line with $strChromeExeFolder:
$strChromeExeFolder= "Your chrome EXE folder with \"
Example 6 Demonstrates all stuff within chrome to navigate html pages, find hyperlink, click hyperlink, find picture, click picture, enter data in inputbox
Example6 has problem, though. It can't create $oChromeToolbar as object in line #48, Here:
&&& $oChromeToolbar =_UIA_getFirstObjectOfElement($oChrome,$cToolbarByName, $treescope_subtree)
Is it concerning with my chrome language ("ru") and invalid names (Russian) of const $cToolbarByName, $cAddressBarByName, and $cChromeNewTabByName?
The point of world view
yes if you change the constants it should start to workmost likely its the language of chrome (not sure if you can put it on Dutch language as thats the Chrome I have)You could dump all objects* Close everything except SCITE and ChromeThen withfindThemAll($oDesktop,$treescope_subtree)you can dump the whole hierarchy to the output window (but it will show a lot of lines)
Thank you.
It works until
$oForumLink=_UIA_getObjectByFindAll($oDocument,"name:=Forum", $treescope_subtree)
So script is true before Action 7 and reports the following:
Action 7 retrieve document after clicking a hyperlink
Title is: &&& & Class & := &Chrome_RenderWidgetHostHWND&& & controltype:= &50030& &
&D:\Program Files\AutoIt3\Examples\IUIAutomation\UIAWrappers.au3& (424) : ==& Variable must be of type &Object&.:
$obj.getCurrentPattern($PatternId, $pPattern)
$obj^ ERROR
The point of world view
I see here some possibility for Chrome, something richer than run, winwaitactive, send("login tab password enter"). Thanks a lot. I'll experiment with it somewhen my brain's not melting from a week's work, next monday.
I have a question though: does this bring possibility for Java application?
I'm thinking about Oracle Sql Developer here. In both case (chrome and sqldev), my scenario is KeePass url/login/password/etc entry, double clic =& [autoit connector] =& Application running and connected. Regarding Sql Developer, AU3Info just tell me it's a SunAwtFrame, and except sending tab or clic on coordinate we can't create a new connection.
0 members, 2 guests, 0 anonymous users
Reply to quoted posts&&&&& &&&
Need an account?
Username or email:
Remember me
This is not recommended for shared computers
Sign in anonymously
Don't add me to the active users list

我要回帖

更多关于 oracle建表语句 的文章

 

随机推荐