Sign in to follow this  
Followers 0
Moriba

_IEFormElementOptionSelect Not Work

11 posts in this topic

#1 ·  Posted (edited)

#include <IE.au3>

Local $oIE = _IECreate("http://www.emui.com/plugin.php?id=unlock&mod=detail")
Local $ocheckType = _IEGetObjByName($oIE, "checkType")
Local $oproductName = _IEGetObjByName($oIE, "productName")
Local $osn = _IEGetObjByName($oIE, "sn")
Local $oimei = _IEGetObjByName($oIE, "imei")
Local $ocheckPassword = _IEGetObjByName($oIE, "checkPassword")
_IEFormElementOptionSelect($ocheckType, "智能手机", 1, "byText")
_IEFormElementOptionSelect($oproductName, "HUAWEI C8813", 1, "byText")
_IEFormElementSetValue($osn, "Z3DBYB9332212412")
_IEFormElementSetValue($oimei, "A000004336D50A")
_IEFormElementSetValue($ocheckPassword, "42244250")

uhSBadn.png

Edited by Moriba

Share this post


Link to post
Share on other sites



"Doesn't work" isn't very helpful. Run the script in Scite and then post the Output window results.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

No Error In SciTE But Not Select "HUAWEI C8813"

Edited by Moriba

Share this post


Link to post
Share on other sites

Here my output...

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:Test.au3" /UserParams    
+>23:51:14 Starting AutoIt3Wrapper v.2.2.0.0 SciTE v.3.4.1.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0409)
+>         SciTEDir => C:Program Files (x86)AutoIt3SciTE   UserDir => C:UsersKyaw Swar ThwinAppDataLocalAutoIt v3SciTEAutoIt3Wrapper   SCITE_USERHOME => C:UsersKyaw Swar ThwinAppDataLocalAutoIt v3SciTE
>Running AU3Check (3.3.10.2)  from:C:Program Files (x86)AutoIt3  input:C:Test.au3
+>23:51:14 AU3Check ended.rc:0
>Running:(3.3.10.2):C:Program Files (x86)AutoIt3autoit3.exe "C:Test.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
+>23:51:15 AutoIt3.exe ended.rc:0
+>23:51:15 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.868
 

Share this post


Link to post
Share on other sites

IDK. Are you sure that value is present in the Select element? Does the element update if you run the command?:

_IEFormElementOptionSelect($oproductName, 2, 1, "byIndex")

Share this post


Link to post
Share on other sites

2nd drop down menu values gets updated once the 1st drop down menu option is selected, put a sleep between the _IEFormElementOptionSelect for $ocheckType and the $oproductName, or check the contents of the 2nd drop down menu before selecting one.

Share this post


Link to post
Share on other sites

Look through the html source...it's possible it may queue off a 'blur' event, which you would have to perform, manually.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

This code work. But it is really ugly.

#include <IE.au3>

For $i = 1 To 2
    Local $oIE = _IECreate("http://www.emui.com/plugin.php?id=unlock&mod=detail", 1)
    If @extended Then
        Local $oproductName = _IEGetObjByName($oIE, "productName")
        _IEFormElementOptionSelect($oproductName, "HUAWEI C8813", 1, "byText")
    Else
        Local $ocheckType = _IEGetObjByName($oIE, "checkType")
        _IEFormElementOptionSelect($ocheckType, "智能手机", 1, "byText")
    EndIf
Next

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Isn't that really the equivalent of this?

#include <IE.au3> 
Local $url = "http://www.emui.com/plugin.php?id=unlock&mod=detail"

Local $oIE = _IECreate($url)     
Local $oproductName = _IEGetObjByName($oIE, "productName")         
_IEFormElementOptionSelect($oproductName, "HUAWEI C8813", 1, "byText")     

$oIE = _IEAttach($url, "url")
Local $ocheckType = _IEGetObjByName($oIE, "checkType")         
_IEFormElementOptionSelect($ocheckType, "智能手机", 1, "byText")

Edit: Fix foreign characters

Edited by Danp2

Share this post


Link to post
Share on other sites

This code work too. Could anyone better to improve it?

#include <IE.au3>

Local $oIE = _IECreate("http://www.emui.com/plugin.php?id=unlock&mod=detail")
Local $ocheckType = _IEGetObjByName($oIE, "checkType")
_IEFormElementOptionSelect($ocheckType, "智能手机", 1, "byText")
Local $oIE = _IECreate("http://www.emui.com/plugin.php?id=unlock&mod=detail", 1)
Local $oproductName = _IEGetObjByName($oIE, "productName")
_IEFormElementOptionSelect($oproductName, "HUAWEI C8813", 1, "byText")

Share this post


Link to post
Share on other sites

You should be trying to determine why $oIE is being invalidated by the prior call to _IEFormElementOptionSelect. Perhaps the underlying javascript is refreshing the page...

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  
Followers 0