Jump to content
AnakondaSK

Little help with my job script

Recommended Posts

AnakondaSK

Hello guys,

I am quiet new here and most important only beginner in scripting.

One part of my work in my job is inserting pretty much the same information into Web Application of my company.

So I made simply mousle click script and it kinda worked. Few colleagues saw it and they want this script too,  so I decided to improve it and make it more suitable and better for other computers.

Mostly i removed mouse click and things that can make some errors for other users.

I made it slowly but quiet good, but i have one problem on the end of process. In Web app i have 3 bookmarks (Page 1,2,3 -The green ones). Every bookmark has own yellow fields where i am inserting required data. I find out that i can move through yellow fields just by Tab key, but my problem is I am unable to move/switch without mouse click to other green bookmarks and to get acces to "page2" yellow fields. 

This web app is running on Mozilla Firefox, so my attempt to get information from Autoit window info failed (I got only information about the page)

So i would like to ask you guys, is there any way to do ControlClick just by knowing the name of the bookmark ?(because all my attempts and searching for answers failed)

Or any way how to press that green bookmark without using Mouse Click and only knowing the name of Bookmark

I would be thankful for any help or advice.

Have a nice day and thanks for any help! :)

Here is Example i made how it looks like (I have restriction of putting screens of real app)

Example1.thumb.jpg.2ebd093f4d206801dee4c

Ps. not sure if it helps but this web app has searh tool and after typing "page2" it will highlight the bookmark. (Then it is possible copy the name, but nothing like enter ot etc is not working even if the bookmark is highlight.

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
232showtime

wheres your code???


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
jvds

if it is web based and you can open it with Internet explorer then you will need to eat up the IE related functions examples in the help file,that is probably the best way to go, its not going to be easy if you are new, so prepare to spend a lot of time on it if you want to get anywhere, but once you get it to work its fun!

Share this post


Link to post
Share on other sites
AnakondaSK

wheres your code???

Sorry, here it is. Its only part of whole code. This part is for Autofill information to this WebApp. Dont know why but i cant post it here through the  "add code" function so this is only way it works for me. Hope its fine.

HotKeySet("{ESC}", "Terminate")
Opt("WinTitleMatchMode", 2)
Opt("MouseCoordMode",0)

Global $Data1
Global $Data2

$Data1="Text that is different" ;first variability
$Data2="Text that is different"  ;second variability

CREW()

Func CREW()
WinActivate("Process Workspace for Process") ;this open my active Mozilla with app
Send("Process Type") ;this highlight text before my first empty field, from this point i navigate through fisrt bookmark press Tab key
Send("{Enter}")
Send("{TAB}")
Send("{down 2}")
Send("{Enter}")
Sleep(1500)
Send("{TAB}")
Send("Same text I insert everytime") ;Same text every time I fillin this app
Sleep(200)
Send("{Enter}")
Send("{TAB}")
Send("Same text I insert everytime") ;Same text every time I fillin this app
Sleep(200)
Send("{TAB 5}")
Send("{Delete}")
Send("Same text I insert everytime") ;Same text every time I fillin this app
Sleep(500)
Send("{Enter}")
Send("{TAB 2}")
;here insert date from Lotus Notes (working on it in another script)
Send("{TAB}")
Send("{Delete}")
Send("Same text I insert everytime")
Sleep(500)
Send("{Enter}")
Send("{TAB}")
;here insert date from Lotus Notes (working on it in another script)
Send("{TAB}")
Send($Data1) ;Only this text change in inserting info to app
Send("{TAB 4}")
Send($Data2) ;Only this text change in inserting info to app
Send("{TAB}")
Send("{alt}")
Send("Document Type") ;Same text every time I fillin this app
Send("{TAB}")
Send("{down 2}")
Send("{Enter}")
;------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>> Here I need some way to move to second bookmark to continue in process.
EndFunc


Func Terminate()
Exit 0
EndFunc

  

if it is web based and you can open it with Internet explorer then you will need to eat up the IE related functions examples in the help file,that is probably the best way to go, its not going to be easy if you are new, so prepare to spend a lot of time on it if you want to get anywhere, but once you get it to work its fun!

(Problem is I can open it only with Mozilla Firefox :/)

My bad I find out that is possible to run it with Internet explorer too

 

Code.au3

Edited by AnakondaSK

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

    • nooneclose
      By nooneclose
      Hello again, I am in phase two of my help bot. I cannot figure out how to properly code Autoit to click on a webpage button using the I.E UDF. I want to click on the button that I have attached as an image. This button does not have a name but it has an ID. Here is the HTML code for this button that I found using chromes developer inspector.
      HTML Code: 
      <img role="button" tabindex="-1" id="toolactions_INSERT-tbb_image" src="nav_icon_insertkey.gif" alt="New Work Order CTRL+ALT+I" draggable="false"> Here is the code that I have so far:
      ;******************************************************************************* ; Opens IE and fill out a New Workorder ;******************************************************************************* ; Start IE at the ** Tracking Application in ****** $oIE = _IECreate("https:I_am_Bound_by_my_company_to_not_reveal_this_webpage") ; Wait for a browser page load to complete _IELoadWait($oIE) Sleep(6000) ; Store the field names where the important data will be sent Local $nWorkOrderB = _IEGetObjById($oIE, "toolactions_INSERT-tbb_image") _IEAction($nWorkOrderB, "click")  I want my program to click on the button that looks like a piece of paper with a blue # 
      (For those wondering, I am allowed to send images just not the URL.) 
      As always any help would be appreciated. 

    • MJ36
      By MJ36

      How to click this button ? 
      I Try 
       
      func test () $oCorrectObj = "" $tags = $oIE.document.GetElementsByTagName("button") For $tag in $tags $class_value = $tag.GetAttribute("type") If string($class_value) = "buttont" Then $oCorrectObj = $tag MsgBox(0, "Level: ", "Level found :)") Else MsgBox(16, "Failed", "Not found.") ExitLoop EndIf Next If IsObj ( $oCorrectObj ) Then _IEAction ($oCorrectObj, "click") EndIF  
      and
       
      func klik () Local $oFound = "" Local $oBtns = _IETagNameGetCollection($oIE, "span") For $oBtn In $oBtns If String($oBtn.classname) = "yt-uix-button-content" Then $oFound = $oBtn EndIf Next _IEAction ($oFound, "click") EndFunc  
      Please Help 
      Can you click it by name?
    • faustf
      By faustf
      i guys , like title anyone  have idea if is possible , and if yes if  have example to post ?  i find in forum and in google but  i dont know   how can start  to create  button with icon over toolbar near  clock or is  goog before language layout .
      sorry i not post any script but i dont know  where to start
      thankz
      at  all
    • caramen
      By caramen
      Hmmm i am sorry  i had simular problem but i cant find back post. 
       
      How to hide a gui button ? 
       
      I Want to dodge the variable non déclaréd when i make button in
      if statment 
       
      thx before 
    • Yirrlaar
      By Yirrlaar
      #Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
      When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
      Upon click the button it should be clicking it, I see the following inn the console window:
      If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
×