Jump to content
milkmoron

Minimal Scripting Skills - Need help with a script to do Data Entry

Recommended Posts

FrancescoDiMuro
1 minute ago, milkmoron said:

Is the ID search-text?

Yes :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
milkmoron

WinActivate ( "Customer Center - Google Chrome" )

ControlSend ( "Customer Center - Google Chrome", "", "search-text", "CLIENT NAME" )

This is what is I'm running but I cant get it to send the text

 

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@milkmoron
To automate things in a browser, I told you that you should use others UDFs, like IE UDF, Chrome UDF, FireFox UDF...

Best Regards.


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
milkmoron
22 minutes ago, FrancescoDiMuro said:

@milkmoron
To automate things in a browser, I told you that you should use others UDFs, like IE UDF, Chrome UDF, FireFox UDF...

Best Regards.

Okay thanks I thought you meant it was optional.

Share this post


Link to post
Share on other sites
milkmoron
3 hours ago, FrancescoDiMuro said:

@milkmoron
To automate things in a browser, I told you that you should use others UDFs, like IE UDF, Chrome UDF, FireFox UDF...

Best Regards.

I can't get the Chrome UDF to do anything but open a chrome browser. It doesn't work to insert text. I tried all the instructions to install. Even the example script does not fill things in any ideas? I tried IUI also but it seems too complicated.

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@milkmoron
Can you please provide the webpage you are trying to automate? :)
Explain as much as you can what are you trying to do, and post the code you are working with :)

Best Regards.


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
milkmoron
2 minutes ago, FrancescoDiMuro said:

@milkmoron
Can you please provide the webpage you are trying to automate? :)
Explain as much as you can what are you trying to do, and post the code you are working with :)

Best Regards.

Just the example script.

http://www.december.com/html/demo/form.html

#Include <Array.au3>
#Include <Chrome.au3>


; Close any existing Chrome browser

; Start Chrome with the URL "http://www.december.com/html/demo/form.html"
_ChromeStartup("http://www.december.com/html/demo/form.html")

; Wait for the page with the document title of "HTML Form Example"
_ChromeDocWaitForExistenceByTitle("HTML Form Example", 10)

; Set the value of the field labelled "Your age:" to "8"
_ChromeObjSetValueByName("user-age", "8")

; Select the radio button labelled "Female"
_ChromeInputSetCheckedByName("user-gender", true, 1)

; Check the checkbox labelled "Marc Andreessen"
_ChromeInputSetCheckedByName("knows-marc", true, 0)

; Select the option with the text "Lynx"
_ChromeOptionSelectWithTextByObjName("Lynx", "favorite-web-browser")

; Select the option with the value of "daring" (Cherry Garcia)
_ChromeOptionSelectWithValueByObjName("daring", "tried-ice-cream")

; Set the value of the field labelled "Guess the secret password:" to "password"
_ChromeObjSetValueByName("password-guess", "password")

; Select the radio button labelled "Yes"
_ChromeInputSetCheckedWithValueByName("Yes", "nickname", true)

; Set the value of the field labelled "it is:" to "fred"
_ChromeObjSetValueByName("user-nickname", "fred")

; Click the button labelled "Send this survey"
_ChromeInputClickByType("submit")

; Wait for the page with the document title of "Thank You"
_ChromeDocWaitForExistenceByTitle("Thank You", 10)

 

Share this post


Link to post
Share on other sites
FrancescoDiMuro
On 12/7/2018 at 1:15 AM, milkmoron said:

Thanks I'll try it out

Im trying to search business and client names from a single column and paste it into the search bar of the online web system. After that I want to copy text fields from the other agencies system into our system.

Search Picture.png

Can you please provide the source code of this page ( at least, the controls you are trying to automate ) :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
milkmoron
7 minutes ago, FrancescoDiMuro said:

Can you please provide the source code of this page ( at least, the controls you are trying to automate ) :)

Sent in a PM. Is the ChromeUDP up to date? Alot of the people in the thread said it no longer works.

Share this post


Link to post
Share on other sites
milkmoron
Posted (edited)

So I got the script to login and search a static customer name. After Searching I want to click into the customer which is a link to open a application on the desktop. how can I do this _IEAction($oAMSClientSearch, "click") doesn't bring anything up.

Actually Scratch that It Opens a new webpage and then you click into the policy which brings up the application. Still can't get it to work though.

Edit: Got it to open with a static link using _IELinkClickByText.

Edited by milkmoron

Share this post


Link to post
Share on other sites
milkmoron
Posted (edited)

I'm trying to click into a link but I can't find the id by using inspect element. I also tried simplespy. The link seems to be generated by javascript code. Is there a way to define these and then click them?

 

Activity Menu Edited.png

Edited by milkmoron

Share this post


Link to post
Share on other sites
milkmoron
#include <Excel.au3>
#include <Array.au3>
#include <IE.au3>

ControlFocus ( "View Activity", "", "")
Local $oViewActivity = ControlGetFocus ( "View Activity" )

Global $oName1 = ControlGetHandle ( $oViewActivity, "", "Name" )

Local $sText = ControlGetText($oName1, "", "")

;ControlFocus ("[REGEXPTITLE:(?i)(Activity.*)]", "", "" )
MsgBox($MB_SYSTEMMODAL, "", "The text in Edit1 is: " & $oName)


;ControlFocus ( "Activity / Suspense", "", "")
WinActivate ( "Activity / Suspense" )
Local $oActivitySuspense = ControlGetFocus ( "Activity / Suspense" )

;ControlSetText ( "$oActivitySuspense", "", "Description:", "Test" )
ControlSend ( "$oActivitySuspense", "", "Description:", "string" )


MsgBox ( 0, "Worked", "It Worked" )

Trying to copy paste text fields in a application. Do I need to use a UDF? I think I have it setup correctly

Share this post


Link to post
Share on other sites
milkmoron
Posted (edited)

So I'm using IUIAutomation and I'm not sure if I'm doing this correctly but heres my code to select the description text area. Store the value for later and send it to another text area.

#include "UIAWrappers.au3"
ControlFocus ( "View Activity", "", "")
Local $oViewActivity = ControlGetFocus ( "View Activity" )

_UIA_SETVAR("Description","classname:=WindowsForms10.EDIT.app.0.30495d1_r9_ad118")
Local $oPolicy = _UIA_Action("Description","getvalue")

MsgBox($MB_SYSTEMMODAL, "", "The text in Name1 is: " & $oPolicy)

ControlFocus ( "Activity / Suspense", "", "")
WinActivate ( "Activity / Suspense" )

_UIA_SETVAR("FIADescription","title:=Description:")
;_UIA_SETVAR("FIADescription","classname:=WindowsForms10.EDIT.app.0.30495d1_r9_ad14
_UIA_Action("FIADescription","sendkeys", $oPolicy)

It pauses during Local $oPolicy = _UIA_Action("Description","getvalue")

Edited by milkmoron

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

×