Completed
Last Updated: 27 Aug 2013 11:07 by Cody
ADMIN
Cody
Created on: 07 Feb 2013 22:53
Type: Bug Report
2
Coded step to set text gives obtuse JavaScript error
In a customers application, a non coded step to set the text of an input field works just fine. Once you convert it to code it fails with:
Exception thrown executing coded step: '[WebTest1_CodedStep1] : @"Enter text '348.000' in 'PnlMainI2GrdItemTxtQuantityText''.
InnerException:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: 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: '27', ElementLength: '15'
   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:'SetText',Target:'ElementId (tagName: 'input',occurrenceIndex: '27')',Data:'348.000',ClientId:'Client_eaa78ec4-67df-4272-8678-03153c9df4ff',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.ArgumentException: Tag collection is either empty or has less elements than the element occurrence requested. RequestedIndex: '27', ElementLength: '15'
   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.

   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Actions.SetText(Element targetElement, String text)
   at ArtOfTest.WebAii.Core.Actions.SetText(Control targetControl, String text)
   at MySampleTests.WebTest1.WebTest1_CodedStep1() in C:\Users\gibson\Documents\Visual Studio 2010\Projects\MySampleTests\MySampleTests\Customer Tests\WebTest1.tstest.cs:line 102

Test to repro will be attached to internal bug report.
2 comments
Cody
Posted on: 02 Jul 2013 18:45
The customers application we were using to reproduce this problem has changed significantly such that the test from the customer is no longer valid. The customer agreed to recreate the test and send it to us. This bug is on hold until we receive the updated test from the customer.
David
Posted on: 09 May 2013 20:53
We regularly see issues similar to this - they are sporadic and seem to be timing issues, almost as if the DOM is in flux while the step is running.  Looking at an example right now, which is how I stumbled on this item.  These issues are VERY hard to explain to new users who are looking for consistency in results.