WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: hdsouza on November 09, 2014, 08:35:39 AM

Title: Compatability view option
Post by: hdsouza on November 09, 2014, 08:35:39 AM
I am trying to click the submit button on page http://www.like4like.org/user/login.php
The code will not work untill I enable compatability view option in IE
The command used is:
if Input.name == "submit" then  Input.click

Is there another way without having to enable compatability view?
Title: Re: Compatability view option
Post by: JTaylor on November 09, 2014, 10:34:28 AM
I usually do something like this to cover all versions of IE.   I just copied and pasted from a script so you will want to tweak it for what you are doing.

Jim

Code (winbatch) Select


      objEvent = ybrowser.document.createEvent("HTMLEvents")
      xlst = ybrowser.document.GetElementsByTagName("INPUT")
      ForEach i In xlst
        If (i.name == "submit" && i.value == "Submit") Then
          If objEvent == "" Then
            i.click
          Else
            objEvent.initEvent("click", @true, @true)
            i.dispatchEvent(objEvent)
          EndIf
          Break
        EndIf
      Next
 
Title: Re: Compatability view option
Post by: hdsouza on November 10, 2014, 12:28:51 PM
Thanks Jim. That works Great !!!!!!