Jump to content

Recommended Posts

Posted (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 by CaptainBeardsEyesBeard
Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...