Jump to content
Sign in to follow this  
Queener

IE set value

Recommended Posts

Queener

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.")

Share this post


Link to post
Share on other sites
JLogan3o13

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?


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
Queener

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.")

Share this post


Link to post
Share on other sites
allSystemsGo

My experience with various _IEGET functions have always been used with div containers. Is there a div container for this input field?

Try these functions

$iQuery=_IEFormElementGetObjByName($iForm,"inputid")
$iZip=_IEFormElementSetValue($iQuery,$$var)
Edited by allSystemsGo

Share this post


Link to post
Share on other sites
Queener

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.")

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
Sign in to follow this  

×