Jump to content

IE set value


Queener
 Share

Recommended Posts

I'm only doing this for testing before I jump to the project, but I'm not able to get the input to be change.

Here's the info from element inspect

<input name="username" id="username" value="" autocapitalize="off" autocorrect="off" autocomplete="off" class="txt create_input valid" type="text">

 

here's what I tested so far:

    $title = "The Sign-in"
    $user = "test"

if WinWaitActive($title, "") Then
    sleep(2000)
    WinSetState($title, "", @SW_MAXIMIZE)
    WinActivate($title, "")
    sleep(5000)
$oInput = _IEGetObjById($oIE, "username")
_IEFormElementSetValue($oInput, "NewText")
sleep(2000)
MsgBox(1,"test","done")
    Exit
EndIf

 

It worked all the way to maximizing the windows then it couldn't set new value. It just skipped that part and go into msgbox.

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Link to comment
Share on other sites

  • Moderators

So, you know it is getting to a certain point. Have you added any error checking, to see why it is failing? Like checking that $oInput exists?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I'm not sure if this is the right way to add the error handling, but I get 0Not Exist using this code:

if @error Then
    MsgBox(1, "Error", $oInput & "Not Exist")
    Exit
EndIf

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Link to comment
Share on other sites

I do not think it's has div container. It does contain div for the header and footer, but not the body.

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Link to comment
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
 Share

  • Recently Browsing   0 members

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