Jump to content

Recommended Posts

Posted

My script not able to click on the Clear Numbers which is button type. Below is the script and HTML page of that.

<input onclick="clearSIFields(formx, this, 'fieldsinumber', 12)" type="button" value="Clear Numbers">

Local $oIE = _IECreate($URL,0,1)
Local $hWnd = WinWait("[CLASS:IEFrame]", "", 10)
 WinWaitActive($hWnd)
 Sleep(2000)
 ControlClick($hWnd, "Home - Internet Explorer", "[CLASS:IEFrame; INSTANCE:1]")
 Sleep(2000)

$oButtons = _IETagnameGetCollection($oIE, "input")

For $oButton in $oButtons
  
  If String($oButton.value) = "Clear Numbers" Then

        _IEAction($oButton, "click")

        ExitLoop
   EndIf
Next

let me know how to achieve this.

Posted

You haven't given us enough details. At a minimum, post the results shown in the Scite output panel when you run the script with F5.

You could also add some logging using ConsoleWrite() so that you can know things like how many elements were found, their values, etc. This will often allow you to see what is going wrong in your script and allow you to come up with a solution yourself.

Posted

I am not seeing any errors in Output console. Let me know how i can use ConsoleWrite() to know how many elements were found? 

Posted

If you look at the help file for _IETagNameGetCollection, it states

  Quote
Success: an object variable containing the specified Tag collection, @extended = specified Tag count.
Expand  

So you could do something like this --

ConsoleWrite("*** " & @extended & " elements found! ***" & @crlf)

In addition, you could add a line to your loop to view details on each element, such as --

ConsoleWrite("Found - " & $oButton.value & @crlf)

The uses for ConsoleWrite are limitless! :lol:

Posted

   Found the below output
*** 0 elements found! ***
"C:\Desktop\portal.au3" (35) : ==> Variable used without being declared.:
ConsoleWrite("Found - " & $oButton.value & @crlf)
ConsoleWrite("Found - " & ^ ERROR
>Exit code: 1    Time: 13.05
 

Posted
$oButtons = _IETagnameGetCollection($oIE, "input")
ConsoleWrite("*** " & @extended & " elements found! ***" & @crlf)
For $oButton in $oButtons

   ConsoleWrite("Found - " & $oButton.value & @crlf)
 
   If StringInStr($oButton.value) = "Clear Numbers" Then

       _IEAction($oButton, "click")

Sleep(2000)

       ExitLoop
   EndIf
Next

i tried and output console gives below result:

*** 0 elements found! ***
>Exit code: 0    Time: 16.98

Posted

<input onclick="clearSIFields(formx, this, 'fieldsinumber', 12)" type="button" value="Clear Numbers">

Please let me know the next step.Above is the HTML page for the particular Clear Numbers.

Posted

Could you help me the 5 frames which contains the desired elements and how to achiveve them..as i am not able to find any solution..i tired my best but not getting success.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...