CaptainBeardsEyesBeard Posted January 7, 2020 Posted January 7, 2020 (edited) Hi How do I test this html <div id="menu"> <a href="/VATChecker/Home/Active/1">UK Invoices - Active</a>| <a href="/VATChecker/Home/Completed/3">UK Invoices - Completed</a>| <a href="/VATChecker/Home/Active/2">Non-UK Invoices - Active</a>| <a href="/VATChecker/Home/Completed/4">Non-UK Invoices - Completed</a>| <a href="/VATChecker/Admin">Admin</a> </div> Normally I would do something like Local $oIE = _IECreate($IEURL, 1) Local $ObjID = _IEGetObjById($oIE, "menu") if StringInStr($ObjID.innerText, "UK Invoices - Active") then MsgBox($MB_SYSTEMMODAL, "Test Result for field " & $FieldBeingTested, "Test Passed:" & $ObjExpected & " " & $FieldBeingTested & " matches the following value received "& $ObjID.innerText, 4) But I'm getting told it's not an Object I then went "back to basics" and copied the example function as below Local $oDiv = _IEGetObjById($oIE, "menu") MsgBox($MB_SYSTEMMODAL, "Line1", $oDiv) but it returns 0 as the $oDiv Edited January 7, 2020 by CaptainBeardsEyesBeard
Subz Posted January 7, 2020 Posted January 7, 2020 Are you using a local file? If so you need to ensure that $IEURL is in internet format for example "file:///C:/My%20Test/Test.html" otherwise it won't render the page correctly and you will get the message that $objID is not an object.
CaptainBeardsEyesBeard Posted January 7, 2020 Author Posted January 7, 2020 No it's an internet page and renders the page fine
Subz Posted January 7, 2020 Posted January 7, 2020 Strange, when I use your html in a page it works fine for me, is the content in a frame? Or add a Sleep(3000) after _IECreate and then use _IEAttach to re-attach to the object? Unfortunately don't have any other ideas without being able to replicate it.
Nine Posted January 7, 2020 Posted January 7, 2020 It would be kind of useful to know what is the @error after each statement. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
CaptainBeardsEyesBeard Posted January 7, 2020 Author Posted January 7, 2020 I just put this in Local $oDiv = _IEGetObjById($oIE, "menu") if @error Then WriteToConsoleAndLog("Can't pull Obj ID into $oDiv") EndIf And got this in the console Can't pull Obj ID into $oDiv>Exit code: 0 Time: 56.4 Any idea what to do?
Nine Posted January 7, 2020 Posted January 7, 2020 what is the value of @error ? Check also the previous @error value of _iecreate. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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