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

Find an item based on text string

5 Answers 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 06 Sep 2011, 11:18 PM
Ok so I'm at a grid of contact form submissions...

In my recorded test submission I put in some text like "This is a Test Submission"

So now in the grid I need to find that item...click it, then click a delete button

What's the best way to do that?

5 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 08 Sep 2011, 11:24 PM
Hi Steve,

Can you provide us with additional information on your automation scenario? What type of grid are you testing?
Is your application accessible for us to test directly? If not, does a public site exhibit the same behavior? Are you automating in Test Studio or directly in code?

If you'd like to attach additional details, such as a copy of the test (within a zip file), you can create a support ticket which is confidential unlike this forum.

Regards,
Anthony
the Telerik team
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 08 Sep 2011, 11:49 PM
It's a sitefinity form, so I guess you could install a new copy :)

- Create form
- Put it on a page
- Submit results
- Find them in the backend and delete (amidst the other submissions)

Although now that I think about it, I should just do a coded test to delete all submissions with X text... ;)
0
Accepted
Anthony
Telerik team
answered on 09 Sep 2011, 10:59 PM
Hello Steve,

I was able to accomplish this scenario in Sitefinity with three tests: Parent, CreateContact, and DeleteContact.

The Parent test is data driven. The local data table has a "Comment" column. It contains the CreateContact and DeleteContact tests as Test as Steps.

The InheritParentDataSource property of CreateContact and DeleteContact is enabled.

The CreateContact test fills in information on the form and submits it. The Message text box entry step is bound to the "Comment" column in the data.

The DeleteContact test logs into the backend and goes to the page with the grid of submissions (actually a table). In a coded step I locate the Div, Table, and Div within the table cell that contains the "Comment" data:

HtmlDiv cts = Find.ByAttributes<HtmlDiv>("id=frmRspnsesCntView_formsBackendListDetail_ctl00_ctl00_splitter");
 
HtmlTable tbl = cts.Find.ByAttributes<HtmlTable>("id=frmRspnsesCntView_formsBackendListDetail_ctl00_ctl00_ctl00_ctl00_ctl00_itemsGrid_ctl00_ctl00_grid_ctl00");
 
HtmlDiv tt = tbl.Find.ByContent<HtmlDiv>(Data["Comment"].ToString());
tt.Click();

Please see here for more information on data driving find expressions.

All the best,
Anthony
the Telerik team
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 09 Sep 2011, 11:01 PM
Hmmm, so this means I'd leave Test Studio, and open the test in express to add in the coded step then?

Would I be able to see a screenshot or a JING of your setup on this test by any chance at all? :D?
0
Anthony
Telerik team
answered on 09 Sep 2011, 11:39 PM
Hello Steve,

No, you can easily add a coded step in the Standalone version with our Script Step feature.

Here is a list of each screen shot attached and a brief description of each:

  1. The Parent test. It calls each child test via the Test as Step feature.
  2. The Local Data table of the Parent test.
  3. The project tab. Highlight each child test and enable its InheritParentDataSource property.
  4. The CreateContact child test. Step 8 is highlighted to show it is data bound to the "Comment" column from the Parent's data table. Notice how that is set on the right in the Data Driven Editor.
  5. The DeleteContact child test. Step 11 is the coded step that clicks the appropriate area of the table that contains the data from the "Comment" column.

Kind regards,
Anthony
the Telerik team
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Anthony
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or