Derk Posted July 19, 2011 Share Posted July 19, 2011 I have a webpage that i am looking to click several buttons. The first page has a new PO button with the ID of 'L_NewItem' and i am able to automate this, but when it goes to the second page to click Save and Close with the ID of 'L_NewFormSaveClose' i am unable to automate it. Here is the code. Do i need to put in an if then statement. You must excuse me as i am new to autoit and scripting. After this page there is an addtional field that is named Purchase Order No. that i would like to copy and paste into another application #include <IE.au3> $oIE =_IECreate("https://domain.com/C0/Purchase%20Order%20Number%20Generato/Lists/Purchase%20Order%20Number%20Generator/AllItems.aspx") ;New Po Number $oNewPOBTN = _IEGetObjByName($oIE, 'L_NewItem') _IEAction ($oNewPOBTN, "click") ;Save and Close Button $osavclose = _IEGetObjByName($oIE, 'L_NewFormSaveClose') _IEAction ($osavclose, "click") Link to comment Share on other sites More sharing options...
Derk Posted July 27, 2011 Author Share Posted July 27, 2011 Can anybody give me some direction with this? Link to comment Share on other sites More sharing options...
Derk Posted July 27, 2011 Author Share Posted July 27, 2011 So I had to add a _IELoadWait($oIE) in between. No all i have to to is figure out how to copy the text from the PO field. Link to comment Share on other sites More sharing options...
Derk Posted July 27, 2011 Author Share Posted July 27, 2011 I came up with this and it finds IPO but includes other text. I am trying to just have it copy the PO numbr "IPO000" for example. ;search the page $sText = _IEBodyReadText ($oIE) $aText = StringSplit($sText,@CRLF) ; Locate any text with IPO For $x = 1 to $aText[0] If StringInStr($aText[$x],"IPO") Then msgbox(0,"",$aText[$x]) EndIf Next Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 29, 2011 Share Posted July 29, 2011 There might be better ways to read the text you want. Since we don't see the HTML of the page you are working with, it's hard for us to see how to help. You might look at _IEPropertyGet() for the "innnerText" property. It depends on the specifics of the element you are reading. Have you used a DOM Inspector like DebugBar on the page? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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