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

'Tag collection is either empty or has less elements' after Customize step in code

2 Answers 22 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 2
Alan asked on 12 Mar 2013, 03:37 PM
Hello,

In several instances, I have needed to enter DateTime.Now.ToString() into a textbox, so I would initially record step to "enter text 'alan' into txtComment" and then customize that step in code.  I use to have success in this, but within the past few months, I have not.  I have even tried converting the step without modifying anything and I receive the same error.  Below is what I have tried so far.  We are using version 2012.2.1420.

Pages...txtComment.Value = DateTime.Now.ToString();
Actions.SetText(Pages...txtComment, DateTime.Now.ToString());

As stated above, when simply converting the step to code, the test fails:

Actions.SetText(Pages...txtComment, "alan");

I know this is very simple to do, so I must be overlooking something.

Thanks,
Alan

2 Answers, 1 is accepted

Sort by
0
Byron
Telerik team
answered on 15 Mar 2013, 04:35 PM
Hello Alan,

I'm sorry you're running into this difficulty. In general, the approach you used should work. For example, after navigating to http://www.bing.com, the coded step:

// Enter current date and time in 'SbFormQText'
Pages.Bing.SbFormQText.Value = DateTime.Now.ToString();

enters a current date string into the Bing search field. Likewise with:

// Enter current date and time in 'SbFormQText'
Actions.SetText(Pages.Bing.SbFormQText, DateTime.Now.ToString());

Please provide more information on the error you receive, as well as a sample test project that produces the behavior, and we will help you resolve this issue.
All the best,
Byron
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Alan
Top achievements
Rank 2
answered on 17 Apr 2013, 08:29 PM
Apologies for the delayed response...thanks for the info, but I am still experiencing the issue.  I will submit a ticket.

Alan
Tags
General Discussions
Asked by
Alan
Top achievements
Rank 2
Answers by
Byron
Telerik team
Alan
Top achievements
Rank 2
Share this question
or