This is a migrated thread and some comments may be shown as answers.

Not clicking on Button

1 Answer 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ravi
Top achievements
Rank 1
ravi asked on 17 Sep 2010, 11:05 AM
Hi,

There is a button on a dailog form in my application.  Tool is regconising the button through code, Iam ablte create an element instance but it is throwing error when click event is called. Pls advise what is wrong

below is the error displayed in exception

ExecuteCommand failed!
InError set by the client. Client Error:
System.ArgumentException: Tag collection is either empty or has less elements than the element occurrence requested. RequestedIndex: '3', ElementLength: '1'
   at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage id)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'Click',Target:'ElementId (tagName: 'button',occurrenceIndex: '3')',Data:'',ClientId:'Client_ae6b05e1-a3ca-49fe-a64d-c829bbbe3b52',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'0',InError:'True',Response:'System.ArgumentException: Tag collection is either empty or has less elements than the element occurrence requested. RequestedIndex: '3', ElementLength: '1'
   at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage id)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

Here i am attaching the screen shot of the Exception. below is the button code in that form.

<BUTTON style=\"WIDTH: 80px\" id=cmdCancel class=pagebutton onclick=Page.CloseDialog(); fpId=\"3485\" nodis="False">Cancel</BUTTON> .

I tried it by recording but no actions recored on it.

Thanks

Ravi






1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 23 Sep 2010, 12:45 AM
Hi ravi,

What is the line of code that is throwing the exception? What is it trying to do? Can you share with us the code surrounding the point of failure? The error message sounds something like the code is trying to get the child element at index 3, but there's only one child element of the current element. Without being able to see the entire code and not accessing the web application it is very difficult for us to troubleshoot problems like these.

Greetings,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
ravi
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or