Jump to content
ur

How to automate button click in IE

Recommended Posts

ur

For the below form, I am able to automate using below code for textboxes.

1.JPG

#include <IE.au3>

Local $oIE = _IEAttach("http://localhost:18170/MartAdmin/", "url")
_IELoadWait($oIE)

$Search = _IEGetObjById($oIE,"x-auto-16-input")
_IEPropertySet($Search, 'innerText','Uday KIran')

$Search = _IEGetObjById($oIE,"x-auto-18-input")
_IEPropertySet($Search, 'innerText','Uday KIran')

But for the Login button, there is no id or name.

The html code when I click on Inspect element in browser, shown below.

<button tabindex="0" class="x-btn-text" style="width: 64px; position: relative;" type="button">Log In</button>

Please let me know how to click this.?

 

Share this post


Link to post
Share on other sites
ur

when I click on view source, I am getting only below code

 

<!doctype html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <link type="text/css" rel="stylesheet" href="gxt/css/gxt-all.css" />
    <link type="text/css" rel="stylesheet" href="css/ca-all.css" />
    <link type="text/css" rel="stylesheet" href="MartAdminConsole.css">   
     
    <title>erwin Mart Administrator</title>    
   
  </head>

  <body>

    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
    
    <div id="loading"> 
        <img src="gxt/images/default/shared/large-loading.gif"  
        width=" 32" height=" 32 " />Loading...<br />
    </div>
    
     <script type="text/javascript" language="javascript" src="MartAdminConsole/MartAdminConsole.nocache.js"></script>
  </body>
</html>

with inspect element I am getting below.

Capture.JPG

 

_IETagNameGetCollection giving empty value with table tag.

Share this post


Link to post
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

  • Similar Content

    • SkysLastChance
      By SkysLastChance
      I am trying to grab the id "in2xk_26" however it the characters before the underscore always change. (in the name too)
      Is there a way I can find a id or name by the last 3 charcters?
      Using something like "stringright?"
      So I would want to search for just "_26" in this case.
      This is assuming that there are no other _26
       

      #include <Excel.au3> #include <IE.au3> #include <GUIConstantsEx.au3> Global $iMousespeed = 25,$target = "",$TagName = "",$Value = "",$Atrribute = "" $oIE = _IEAttach("MEDITECH") $TagName = "input" $Value = "in2xk_26" $Attribute = "id" $tags = $oIE.document.GetElementsByTagName($TagName) ;TagName ------ MAKE SURE TO NAME THESE For $tag in $tags $class_value = $tag.GetAttribute($Attribute) ;Attribute ------ MAKE SURE TO NAME THESE If string($class_value) = $Value Then ;Value ------ MAKE SURE TO NAME THESE $target = $tag $iScreenX = _IEPropertyGet($target, "screenx") $iScreenY = _IEPropertyGet($target, "screeny") $iWidth = _IEPropertyGet($target, "width") $iHeight = _IEPropertyGet($target, "height") $oMouseCords = MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed) MouseClick($MOUSE_CLICK_LEFT) ExitLoop EndIf Next  
       
    • SkysLastChance
      By SkysLastChance
      I was wondering how I read data inside of a iframe. I would like to be able to click something inside a iframe. However, I can't even find the tag. 
      The id and name change all the time so I can't use those. 
      The code highlighted in blue is what I am trying to click. (second picture)
      Here is what I have tried.
      $target = "" $tags = $oIE.document.GetElementsByTagName("div") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "s_92 altstyle s_93 s_94" Then $target = $tag ConsoleWrite("Tag Found " & $target.outerText&@CRLF) ExitLoop EndIf Next  

       
       

    • SkysLastChance
      By SkysLastChance
       
      WinActivate("MEDITECH - Internet Explorer") Sleep (500) $oIE = _IEAttach("MEDITECH") $oDiv1 = _IEGetObjById($oIE, "sysmenu-searchbarbutton") _IEAction($oDiv1, "click") I am just trying to click the little magnifying glass, next to the gear button with no luck. I was hoping someone might have an idea why this is not working?
       

    • SkysLastChance
      By SkysLastChance
      I am trying to type a name in patient summary search box. How should I go about doing this. I am clearly not doing it right. (Attached Picture of HTML code.)
      This is what I have tried. I assume this is not working because it is not a form? 
      WinActivate("MEDITECH - Internet Explorer")       Sleep (500)    $oIE = _IEAttach("MEDITECH")    $oForm = _IEFormGetObjByName($oIE, "systemMenu")    $oText = _IEFormElementGetObjByName($oForm, "sysmenu-searchbarinput") _IEFormElementSetValue($oText, "Hey! This works!")
    • seryth
      By seryth
      I have a script that opens some Excel books that  are stored in SharePoint .  Without getting to much into detail as its a very long story I have to open Internet Explorer to the SP site in order for all of this crap to work. 
       
      Anyway I have a bit of code in my script that i found via google-fu
      $ieList = ProcessList("iexplore.exe") If IsArray($ieList) Then For $I = 1 To Ubound($ieList) -1 ProcessWaitClose($ieList[$I][1]) Next EndIf Exit Now on Windows 7 this bit works great.  On Windows Server 2012 R2 where this things runs is another story.  I need to be able to force close all instances of Internet explorer that are running as part of my code. 
       
      Any help is appreciated. 
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.