
acidbat
Members-
Posts
14 -
Joined
-
Last visited
Everything posted by acidbat
-
Need help with clicking a button from a Java script.
acidbat replied to acidbat's topic in AutoIt General Help and Support
Solved this using MouseClick("primary", 299, 47, 1) Not really ideal but it works. -
Hello everyone, Having an issue with getting AutoIT clicking a button on a page. The page is HTML with a bar at the bottom which is created by a JAVA code. The Java code looks like this: <script type="text/javascript"> <!-- //<![CDATA[ blah.addLoadEvent(function(){ var hotKeys = new Corp.Event.hotKeyManager(); hotKeys.add(KEY_V, false, function() {$('save').down('button').click();}); hotKeys.add(KEY_R, false, function() {$('reset').up('form').reset();}); hotKeys.add(KEY_D, false, function() {$('delete').down('button').click();}); hotKeys.add(KEY_K, false, function() {$('reactivate').down('button').click();}); hotKeys.add(KEY_H, false, function() {$('repeatSearch').down('button').click();}); }); //]]> --> </script> The button I am wanting to click is: hotKeys.add(KEY_K, false, function() {$('reactivate').down('button').click();}); Optionally I can do a shortcut key combo (ctrl+alt+k) but I'm having little issue getting that correct as well. Any help would be greatly appriciated. Cheers
-
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
Hmmm not sure what has happened but now it works. No code has been changed remains as this: $dob = _IEFormElementGetObjByName ($oform1, "subject.birthDate") _IEFormElementSetValue($dob, "12/12/1960") What wasn't working is now working.......weird -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
Alright I am little closer now. With this code I had before: $dob = _IEFormElementGetObjByName ($oform1, "subject.birthDate") _IEFormElementSetValue($dob, "12/12/1960") It does write the 12/12/1960 value in the calendar (and not the text field.....) I discovered that when I ran this code: _IEImgClick ($oform1, "cal.gif", "src") It pops up the calendar window and I can see that the values are there. However, next problem I have now is to close the window (if I confirm with the Enter key it will close), but if I try and send("{ENTER}") it does not actually do anything. So my next issue is to close the window by confirming with the enter key or.. Find out why it sticks the value in the calendar and not on the text field next to it... Any ideas? -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
I tried that too (being super excited) but same behaviour there too. $dob = _IEGetObjById ($oform1, "subject.birthDate") _IEFormElementSetValue($dob, "12/12/1960") -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
Just for kicks I added this in my script: for $i = 0 to 10000 _IEFormElementSetValue($dob, "12/12/1960") Next Just thinking, maybe the script is running too fast? But it still runs and attempts to add a value there 10000 times without luck. -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
Yup, tried that too - even 12\12\1966 just to see but nothing is hitting the DOB field (as in, no text is entered - it remains untouched) -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
Noticed now that the DOB field also has a button on the side which brings up a calendar when clicked. Appears to be a DHTML (Dynamic HTML with some Ajax code). Not sure if that helps or not, but i'll keep investigating the issue. -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
Yes, the statements are on two seperate lines I ran the msgbox again (hoping I did this correct) with the following syntax: $dob = _IEFormElementSetValue($dob, "12121966") msgbox(0, "Error Code", @error) Which returned 0 The site is an internal site. I'll try and paste more snippets of my code: $oForm1 = _IEFormGetObjByName ($oIE, "checkSubmitForm") $office = _IEFormElementGetObjByName($oform1, "officeCode") $ctype = _IEFormElementGetObjByName($oform1, "type") $catg = _IEFormElementGetObjByName($oform1, "category") $purp = _IEFormElementGetObjByName($oform1, "purpose") $primaryN = _IEFormElementGetObjByName($oform1, "subject.names(1000).type") $famname = _IEFormElementGetObjByName($oform1, "subject.names(1000).familyName") $givenname = _IEFormElementGetObjByName($oform1, "subject.names(1000).firstGivenName") $dob = _IEFormElementGetObjByName($oform1, "subject.birthDate") <-- No errors $gender = _IEFormElementGetObjByName($oform1, "subject.gender") $country1 = _IEFormElementGetObjByName($oform1, "subject.birthPlace.country") $addrtype1 = _IEFormElementGetObjByName($oform1, "subject.addresses(1000).type") $addrtype2 = _IEFormElementGetObjByName($oform1, "subject.addresses(1000).line") $country2 = _IEFormElementGetObjByName($oform1, "subject.addresses(1000).country") $notes = _IEFormElementGetObjByName($oform1, "note") ; Set field values in the form _IEFormElementSetValue($office, "FF") _IEFormElementSetValue($ctype, "INDIV") _IEFormElementSetValue($catg, "IMMI") _IEFormElementSetValue($purp, "Automation Test") _IEFormElementSetValue($primaryN, "PRIM") _IEFormElementSetValue($famname, "test") _IEFormElementSetValue($givenname, "test") _IEFormElementSetValue($dob, "12121966") <-- Not typing _IEFormElementSetValue($gender, "M") As said before, everything works except for the DOB, I can email you the screenshot and\or part of the HTML code if this internal site if you like? -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
I ran the code you mentioned above and the messagebox returned 0. -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
From memory yes, but I will confirm the exact return message from Scite tomorrow. -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
The difference is that most of the fields are a dropdown list with values and some are a free text field (you can type anything you want). The DOB has the option to enter text or you can click on the calendar icon on the side to specify the date you want from there. Hope that makes sense? -
Need some scripting assistance
acidbat replied to acidbat's topic in AutoIt General Help and Support
appologies for the format -
Hi everyone,I need some help with forms using IE.The form I am working has lots of fields with values I can select from.Good news is that I managed to script just about all of them except for 1.The troublesome one is a "Date of Birth" field and the source code looks like this: <div class="corp-form-part"><div id="" style="" class="corp-form-item"><label>Birth Date<span class="mandatory">*</span></label><input type="text" name="subject.birthDate" value="" id="subject.birthDate" class="corp-calendar "></div> My script looks like this: $dob = _IEFormElementGetObjByName ($oform1, "subject.birthDate") _IEFormElementSetValue($dob, "12121966") But when I execute my script nothing happens and there is no error in my Scite Console either. I used _IEFormElementGetObjByName & _IEFormElementSetValue for all my other fields without any issues but for this DOB it just wont enter anything. Any help would be grealty appriciated. Cheers