Jump to content

Recommended Posts

Posted

Hi all,

I'me pretty new on AutoIT world so forgive if the following question was answered before.

 

I want my AIT script to update a text-field on a specific html page of web-site:

therfore I login the site and when I enter the relevant section, I update the field by the following code:

 

$oFrame = _IEFrameGetCollection($oIE, 1)

$emailElement = _IEGetObjByName($oFrame, "default_cli")

_IEFormElementSetValue($emailElement, "myDefault CLI")

 

No error is returned, and I actually see that the relevant textbox is updated. But when I submit the page, the data is not saved - when I enter the page again I see that the data was not modified.

I'me using IE10 and when I try to use the 'Console mode' (F12) I see that the old data is sent with the submit.

 

The same behvaior happend with all sort of input (select etc).

 

Please help me,

Thanks

 

Nir

Posted

Jos

 

 

Yes, I have submit button on which I press to save the form.

 

I think the key for the problem is somthing the IE - When I opened the console mode of the IE, I see that none of the new values is sent via the confirm button.

Posted

if i were you I will post my script so i can get help from the expert coder... :D:D:D

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Posted

i think that you can risolve with this:

$oFrame = _IEFrameGetCollection($oIE, 1)
$emailElement = _IEGetObjByName($oFrame, "default_cli")
_IEAction($emailElement, 'focus')
Sleep(500)
_IEPropertySet ( $emailElement, "innertext", "myDefault CLI")

god bless you!

Posted

Probably referring to this.

​Yes Danp2,

 when I used 

$oFrame = _IEFrameGetCollection($oIE, 1)
$emailElement = _IEGetObjByName($oFrame, "default_cli")
_IEAction($emailElement, 'focus')
Sleep(500)
_IEPropertySet ( $emailElement, "innertext", "myDefault CLI")

The same behaviot happenes ( I saw the lines updated but the site didn't save the data)

 

Posted

OK, I solve it.

The problem was somthing about Knockout code which were behind the page and prevents  third party programs (such as the AutoIT) to change the input. The key is to use 'execscript'.

The working code is: 

   $command = "top.main_frame.window.viewModel.default_cli('" & "myDefault CLI" & "');"
   $oIE.document.parentwindow.execscript($command)



Thanks for all of you !!

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