Sign in to follow this  
Followers 0
mikehunt114

Form Element Object Name errors

19 posts in this topic

#1 ·  Posted (edited)

Ok, here is my error log:

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Error from function _IEAction, $_IEStatus_InvalidDataType

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Error from function _IEAction, $_IEStatus_InvalidDataType

My macro is quite large, but I'll condense it down to the objects that use the Form commands, and the loop they are used in.

**OLD CODE REMOVED.**

Everything works perfectly fine, for a while ..... hopefully my syntax is correct, I took a lot of it out. Anyways, the macro is obviously having a problem getting the Form Element Object names, thus causing an IEAction() error. So if I just clear up the Form Element problem it should be good. I don't understand why it's having trouble getting the object names. It obviously finds them some of the time, it runs for a while before it errors out. Interestingly enough, on another computer it runs perfectly fine, I've let it run for long periods of time, it gets the same errors, but never kicks out with a terminal error. I tried using "focus", but it just made things worse, since I was calling on objects it didn't always find. If the source code of the website is necessary, I'll PM it to anyone interested in helping me out......thanks.

Edit: Old code removed.

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites



You have serious script design problems and it is likely that you are running the process and/or the system out of resources. Most of your routines call themselves with no logic to unwind (return back to the previous calling level).

Ignoring that (and please don't - it is a serious problem), you'll need to put debugging code in your script prior to the calls causing the errors to examing variables, return status, page HTML source etc.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

I haven't had recursion problems with this setup before, despite the fact that the functions call themselves. I recently updated the script to use _IE functions instead of outdated methods. Some of the recursion I can fix, but would be at a loss as to how to repeat the repeat() function without calling itself. That being said, I'm still asking for your help, so if you think reworking the recursive stuff will fix my problem, I'll take suggestions. As for debugging code, I will be working on that tomorrow morning....thanks.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Ok, my debug code is indicating that the script is erroring when searching for the cast button. This is done under the function clickcast(). It often gets a StatusNoMatch. This is most likely the root of the problem, so I guess I need to find a new way to choose the cast button. There are two buttons, cast (name = btn_cast) and attack (name = btn_attack), and there are two forms (name = castform and name = fightform), one for each button. The buttons appear randomly in one form or the other. How can I find the specific button, and which form it is in?

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Here are the kind of errors I'm getting:

A lot of IEStatusNoMatch's - which I think are acceptable, it's ok if it doesn't always find the button....

followed by a terminal error such as:

C:\Program Files\AutoIt3\beta\Include\IE.au3 (1547) : ==> The requested action with this object has failed.:

If $oItem.text = $s_string Then

If $oItem.text ^ ERROR

>Exit code: 0 Time: 12.656

OR

C:\Program Files\AutoIt3\beta\Include\IE.au3 (2562) : ==> The requested action with this object has failed.:

$o_object.Click ()

$o_object.Click ()^ ERROR

>Exit code: 0 Time: 10.186

C:\Program Files\AutoIt3\beta\Include\IE.au3 (1380) : ==> The requested action with this object has failed.:

Return $o_object.elements.item ($s_Name, $i_index)

Return $o_object.elements^ ERROR

>Exit code: 0 Time: 29.955

What's up with these? Help please....


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Sorry, you still don't understand your code well enough to know when you are getting the errors and under what conditions.

You need to do more debugging and examine execution flow, function return values and page source.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I understand it well enough to see that it gets IEStatusNoMatch's from not finding the button every time the function is called, which shouldn't be a problem. The errors with IE.au3 are the ones that escape me, I have no idea what that tells me. These occur randomly as the call for a form element named "btn_cast" is made.

Edit: button name

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

I understand it well enough to see that it gets IEStatusNoMatch's from not finding the button every time the function is called, which shouldn't be a problem.

I find that hard to accept. It tells me you don't understand your code and are not trapping and managing errors.

The errors with IE.au3 are the ones that escape me, I have no idea what that tells me. These occur randomly as the call for a form element named "btn_cast" is made.

They mean that the object is not valid for the attempted operation. You may have browser pages being refreshed in the middle of your function calls. You may benefit from learning how to use_IELoadWait

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

I know exactly when the error is happening. It happens when it tries to find the button...

_IELoadWait() is being used each time the func clickcast() is being called, directly after it...


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

I stand by my previous post. Create a reproducer and we can take this futher.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Edit: see below

Edit2: Reproducer below

Should be a viable reproducer, let me know if I made any mistakes, but this should result in what I have previously described...

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Sorry, that is a far cry from a reproducer.

If you want help you need to do more of the work yourself and you need to make it easy for those from whom you are seeking help.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I'm trying to give you everything you need, but I need help, that's why I'm asking. I didn't even know what a reproducer was until I sifted through the forums. Please don't patronize me, I'm trying to ask for help nicely...I've spent a lot of time working on this on my own, as well as working on making it clear for you so that I may get advice.

Short of becoming a member to the site yourself, I don't see what other source I can offer to you. What can I do to make this easier for you, specifically?

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

I'm trying to give you everything you need, but I need help, that's why I'm asking. I didn't even know what a reproducer was until I sifted through the forums. Please don't patronize me, I'm trying to ask for help nicely...I've spent a lot of time working on this on my own, as well as working on making it clear for you so that I may get advice.

Short of becoming a member to the site yourself, I don't see what other source I can offer to you. What can I do to make this easier for you, specifically?

Given that you admit to not knowing what a "reproducer" is, you need to be looking at this as education rather than patronization.

In order for someone to help you, you need to either 1) provide analysis that clearly identifies what code path was followed, the specifics of the environment is it working on, the result you obtained and the result you anticipated or 2) a resproducer that allows another person to replicate your environment and circumstances in a lab environment and to obtain the same results you received.

Typically, a reproducer is the simplest environment, shortest piece of code that still demonstrates the problem. It includes everything required for testing and includes detailed, step by step instructions on what needs to be done to set up the environment and run a test(s) that results in the observed error/deficiency. This facilitates focus on the core issue, reduction of analysis time and efficient use of scarce resources.

What you provided me above does not meet these criteria. You do not provide instructions on how to recreate your environment for testing. You do not provide instructions on how to use what you sent to reproduce the problem you experience. The code that you provided is not sufficient (it includes no statement to define the $oIE variable, for example, that everything else relies on).

This is why I said

Sorry, that is a far cry from a reproducer.

If you want help you need to do more of the work yourself and you need to make it easy for those from whom you are seeking help.

Dale

Note: Also, you stated in a previous reply that you use _IELoadWait after each call to something or other and I see no use of it in the code you provided here.


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

A few of your comments just sounded short to me, and I am frustrated that I can't get this to work on my own. I'm trying to learn, so the help IS appreciated.

Ok, so, I will put everything here that you need to reproduce my situation.

Note: The Reproducer.txt should be renamed to Reproducer.ini

The login function isn't implemented yet, so you'll have to navigate your way to the page specified in the _IECreate(). The login and pass can be found in the .ini file. Once logged in, you should not have to do anything but run the script.

//Attachments removed.

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

I ran your code and saw the COM error you reported.

I then added an _IELoadWait after every _IELinkClick*, _IEImgClick* and every _IEAction(xxx, "click") and ran the code for 30 minutes without seeing another one.

This is what I suggested several replies ago. Any time a page change is initiated by one of those action you must use an _IELoadWait to insure that the page is fully loaded before trying to act upon it or you will find that objects are not instantiated and methods and properties are invalid, resulting in COM errors.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

I added more _IELoadWait's in addition to those I already had...I put them directly inside the functions this time, after each _IEImgClick, _IELinkClickByText, and _IEAction. I still receive the same error:

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

C:\Program Files\AutoIt3\beta\Include\IE.au3 (1380) : ==> The requested action with this object has failed.:

Return $o_object.elements.item ($s_Name, $i_index)

Return $o_object.elements^ ERROR

>Exit code: 0 Time: 17.138

Where exactly did you put your _IELoadWait's? Or am I missing something else simple?

Edit: not limited to that specific error, here is another example:

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch

C:\Program Files\AutoIt3\beta\Include\IE.au3 (1547) : ==> The requested action with this object has failed.:

If $oItem.text = $s_string Then

If $oItem.text ^ ERROR

>Exit code: 0 Time: 138.648

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

I played around with _IELoadWait, also tried some sleeps, still getting these errors. However, on a different computer this script will run indefinitely, and not produce any errors whilst doing actions in IE.au3.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

This problem was resolved by adding my own error function to handle these kind of cases. It didn't matter whether the script had an error finding the button or not, I wanted the script to continue. While the errors occured in IE.au3, it was just the passing of incorrect objects to it that caused the errors, duh. In any case, no more terminal errors, just instances where it doesn't find a match. Thanks for the help Dale.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

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