SorryButImaNewbie Posted January 6, 2015 Share Posted January 6, 2015 (edited) Sorry to come here with such a question (this is going to be my trademark it seems). I'm writing a script now to stress test a webpage (not DoS, my company wants to test our supplier:) ) I never done that with autoit but i seems to get a handle on it quickly enough,but i have a problem. How do I learn the pages buttons names or ids, so I can interact with them? Local $oLoginButton = _IEGetObjById($oIE, "login_button") _IEAction($oLoginButton, "click") how do I know/learn the "login_button" name as the browser refar to the button? I can probably mine it out from the sourcecode, but that would take an immense amount of time compared to, well anything. Edit: and by mining, I mean search for it manually, I know only a few professinaly sounding words about datamining Thank you guys! I hope others may find my questions usefull one day Edited January 6, 2015 by SorryButImaNewbie Link to comment Share on other sites More sharing options...
computergroove Posted January 6, 2015 Share Posted January 6, 2015 Autoit has a info tool that will tell you control names. Look in your autoit installation directory. It's called Au3Info.exe. Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted January 6, 2015 Author Share Posted January 6, 2015 Yeh but in a browser it only says Internet Explorer_Server (as it should) on the entire browser Link to comment Share on other sites More sharing options...
MikahS Posted January 6, 2015 Share Posted January 6, 2015 What is the error you're receiving with this code? Local $oLoginButton = _IEGetObjById($oIE, "login_button") _IEAction($oLoginButton, "click") Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Bert Posted January 6, 2015 Share Posted January 6, 2015 Autoit has a info tool that will tell you control names. Look in your autoit installation directory. It's called Au3Info.exe. That does not work for web pages. use this: http://www.microsoft.com/en-us/download/details.aspx?id=18359 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
alienclone Posted January 6, 2015 Share Posted January 6, 2015 http://www.debugbar.com/ If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted January 7, 2015 Author Share Posted January 7, 2015 Thank you guys! I go with Bert's suggestion (I dont want to talk with IT security to check debugbar and etc, company standard) but thanks for it alienclone. I only learnt unfourtunetly what i manually found from the HTML code. what should i do If there are more then 1 control with the same class? I think there should be an index or something, that allows to differentiate between the controls, but can't find it. I would like to click on a link (image basicly if im right) with something like this Local $oLinks = _IELinkGetCollection($Explorer) For $oLink In $oLinks Local $sMyString = "somethingsomething" Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next so what if there are 4 "somethingsomething"? The only thing that is different is the link they send me. (href) An other code i try is If $x = 1 And $y = 1 Then $oLink = _IEGetObjById($Explorer, "/vasarlas?kategoria=d1&ervenyesseg=2") ;A tovább gombra nyomás a címbeállítás után _IEAction($oLink, "click") _IELoadWait($Explorer);MsgBox(0, "Teszt","Itt vagyok!") EndIf where I tried to use the link's string to identify the link, but it doesnt work Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted January 7, 2015 Author Share Posted January 7, 2015 Okey I tried both, but they gave me no usefull information regarding the controls, no names/ids what ever. I doubt that they have any... what can i do? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2015 Moderators Share Posted January 7, 2015 (edited) Do you know what an "id" is (_IEGetObjByID())? Because, I'm pretty sure: "/vasarlas?kategoria=d1&ervenyesseg=2" is not an ID. I'm also pretty sure that if you're using AutoIt at work to program, that your IT department won't have an issue allowing you to install a tool that allows you to get all the information you're looking for. And will be thankful that you're running code on their machines that you've used the proper tools to find the correct values for. If you're not doing the programming at work, then download the tool, use the green drag icon to drag over (and drop) on the control/link/etc you want to work with. Within the innertext it will give you the data you need. The only other option you're going to get really is to post the url you're working with, for those of us that do have the proper tools (eg. debugbar) can take a look. Edited January 7, 2015 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now