Jump to content

Embedded IE button click not working


KeshHERE
 Share

Recommended Posts

#include <String.au3>
#include <AutoItConstants.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <MsgBoxConstants.au3>


Global $url='http://buy.mi.com/in/buy/product/mix2'


$oIE = _IECreateEmbedded()
$hGUI=GUICreate('Embedded', @DesktopWidth-50, @DesktopHeight-100,10,10)
$oIEobj=GUICtrlCreateObj($oIE, 10, 10, @DesktopWidth-50, @DesktopHeight-100)



GUISetState()

add()

Func add()
_IENavigate($oIE,$url)
Sleep(1000)
_IELoadWait($oIE)
Sleep(2000)

$oStartDatePicker = _IEGetObjById($oIE, "J_nextBtn")
If StringInStr($oStartDatePicker.innerText,'buy') Then
    $oStartDatePicker.fireEvent("onclick") ; tried both before and after onclick fireevent but nothing worked
    $oStartDatePicker.click
;~  $oStartDatePicker.fireEvent("onclick")
   _IELoadWait($oIE)
   Sleep(2000)
EndIf
EndFunc

Above is my code right now. I tried with and without fireEvent parameter but nothing seems to work on clicking the button. Events on clicking button are executing JS so maybe something that is related to that is not making it work.

any help would be appreciated ! Thanks :)

 

ANSWER:

Sorry guys, I had a typo in code that was the reason it was ".click" instead of ".click()" , I don't seem to be able to find how to delete this question so if any mod want to do it go ahead. :) Appreciated.

Edited by KeshHERE
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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