Jump to content

Recommended Posts

Posted

Hello there,

I am new to AutoIt; but I have been exploring its potential for automating web-related tasks. I am working on a project that involves filling out a dynamic web form. This form changes based on the users initial input.

I have been able to handle basic interactions using the _IE functions; like filling out static fields and clicking buttons. Although; I am running into issues with detecting and interacting with the dynamically added elements. Specifically:

When new fields appear after a selection; how can I reliably identify them in AutoIt? I have tried using _IEGetObjById and _IEGetObjByName, but sometimes these fields do not seem to be recognized immediately.

There is a noticeable delay when the new elements load. I have tried adding Sleep commands; but I am not sure if that’s the best approach. Is there a more efficient way to wait for the DOM to update?

Some interactions seem to rely heavily on JavaScript; like triggering dropdowns or validations. Is there a way in AutoIt to simulate these JavaScript driven events more effectively?

Also, I have gone through this post; https://www.autoitscript.com/forum/topic/211925-could-someone-guide-me-on-automating-user-login-and-data-salesforce-commerce-cloud-from-web-application/  which definitely helped me out a lot.

Thanks in advance for your help and assistance.

Posted (edited)

the two main ones suitable for this job are

  1. UI Automation UDFs
  2. WebDriver UDF

both are difficult for a beginner, but worth the effort because they are basic elements (especially for the Internet)


Here  @SOLVE-SMART  has made a nice  quick entry point  for getting started with WebDriver UDF.


here's another way to wait

Local $iTimeout = 10000 ; Set timeout 10 seconds
Local $iStartTime = TimerInit()
Local $oNewElement = ""

; Wait for the new elements max 10 seconds
While Not IsObj($oNewElement)
    Sleep(100)
    $oNewElement = _IEGetObjById($oIE, "newElementId")

    ; Check if timeout
    If TimerDiff($iStartTime) > $iTimeout Then
        MsgBox(48, @ScriptName & " (" & @ScriptLineNumber & ")", "The new element did not found")
        Exit ; Exit? ExitLoop ?  handle as needed
    EndIf
WEnd

 

:welcome: to forum

Edited by ioa747

I know that I know nothing

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
×
×
  • Create New...