atnextc Posted August 2, 2009 Share Posted August 2, 2009 (edited) I have the debug bar for IE installed and I used the "spy other IE instances" option for it to look for a specific line of code on this CRM webpage that I am using for work.What it pulled is below:<TD class=ms-crm-Form-StatusBar colSpan=2><B>Status:</B> <SPAN id=crmRenderStatus><SPAN id=EntityStatusText>Active</SPAN></SPAN> </TD></TR></TBODY></TABLE></BODY></HTML>The part that I'm interested in is in bold above. Basically a case can either be in active or resolved state, and right now I have a script that resolves a case but I have it sleeping x number of seconds until it closes the case. What I want to do to make it more efficient is to have it look to see when Status:Resolved then it goes ahead and closes the case.below is the script I'm using in case someone needs to look at it. As always thanks in advance.Winwaitactive("Resolve Case -- Webpage Dialog") MouseMove(653, 397) MouseClick("left") Send("Closed") Send("{ENTER}") Sleep(5000); Right Here is where I'm waiting until the "close button" appears on the screen before it mouse moves and clicks on close for me. ; Depending on how fast or slow the CRM server is running this time varies, and its a pain to manually play with the sleep time, I just want it to wait until the status of the case = resolved before moving. MouseMove(67, 137) MouseClick("left") Edited August 2, 2009 by atnextc Link to comment Share on other sites More sharing options...
exodius Posted August 2, 2009 Share Posted August 2, 2009 (edited) Based on the code you've provided, it sure doesn't look like you're tapping into the full-potential of the _IE functions included in AutoIt...My suggestion, play with _IECreate, _IENavigate, _IEGetObjByName, _IEFormElementSetValue and _IEAction (for clicking) to open the page and get it where you need to check for this in the first place, it'll be a lot more reliable than MouseClick.Alternatively, you can at least do an _IEAttach to hook into the window if it's already pulled up...Once you've gone down one of those two roads, see what _IETableGetCollection and _IETableWriteToArray give you.This code will probably help you if you don't know what table # it is on the page:#include <IE.au3> #include <Array.au3> ; I've put cnn.com as an example, you're going to replace this line with the $oIE object you'll end up with from either _IECreate or _IEAttach. $oIE = _IECreate("www.cnn.com") $oTable = _IETableGetCollection ($oIE) $iNumTables = @extended For $x = 0 to $iNumTables-1 $oTable = _IETableGetCollection ($oIE, $x) $aTableData = _IETableWriteToArray ($oTable, True) _ArrayDisplay($aTableData, "Table " & $x & " out of " & $iNumTables-1) Next Edited August 2, 2009 by exodius Link to comment Share on other sites More sharing options...
atnextc Posted August 2, 2009 Author Share Posted August 2, 2009 (edited) Thanks for the input exodius i'll look more in depth about the things you posted and i'll let you guys if I run into anymore problems. Edited August 3, 2009 by atnextc Link to comment Share on other sites More sharing options...
exodius Posted August 2, 2009 Share Posted August 2, 2009 Well then, good luck on getting help from someone else if that's the type of response you're going to give to advice that assumes you're willing to learn how to do something new in AutoIt. 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