This project is read-only.

find a dynamic control

Sep 21, 2012 at 12:19 AM

Can I use CUITe to find a dynamic control? Depends on the test cases, some controls will or will not appear in the web page. In addition, their id and name properties are automatically generated by the code. So how to find them in the web page?

Thank you so much.

Sep 21, 2012 at 12:45 AM

See a similar discussion:

http://cuite.codeplex.com/discussions/394646

Sep 21, 2012 at 1:05 AM

I read that discussion, it uses the value property of the control to search the control. But in my application, I do not know the value, id and name of the control.

                Subject 1 Subject 2

Student 1      9              8

Student 2      5              6

In the table above, how can I get or set the Student 1's mark of Subject 1 or 2? For example, one step in the test case is get the mark of student with the parameters are name of Student and Subject. And depends on the test cases, we will have different the number of students and subjects.

Thank you so much.

Sep 21, 2012 at 5:10 AM

Hi selecao338,

You can use the CUITe_HtmlTable.GetCell() method from the latest code (specifically changeset 20294).

For example,

 

CUITe_HtmlTable tbl = new CUITe_HtmlTable("id=myTable");

CUITe_HtmlCell cell = tbl.GetCell(0, 0); //get row at index 0 and cell at index 0

CUITe_HtmlEdit edit = cell.Get<CUITe_HtmlEdit>(); //get text box in cell

edit.SetText("10"); //set mark for Student 1 in Subject 1 to 10

I have not personally tried this though.

 

Sep 21, 2012 at 6:06 AM

Can I get the index of row and column based on the text "Student 1" and "Subject 1"? I want to do this because in my web application, there are some hidden columns and maybe in the future, the developers will change the position of the rows and columns.

Thank you.

Sep 21, 2012 at 7:20 AM

Yes.

You can try looking at the returned value of the the CUITe_HtmlTable.GetColumnHeaders() method.

Sep 25, 2012 at 12:37 AM

I have errors in line 2 and 3:

 CUITe_HtmlTable tbl = new CUITe_HtmlTable("id=myTable");
 CUITe_HtmlCell cell = tbl.GetCell(0, 0); //get row at index 0 and cell at index 0

 CUITe_HtmlEdit edit = cell.Get<CUITe_HtmlEdit>(); //get text box in cell
It is said that CUITe_HtmlTable does not contain a definition for GetCell and CUITe_HtmlCell does not contain a definition for Get.

Sep 25, 2012 at 3:10 AM

You probably aren't using the latest code (specifically changeset 20294), like I mentioned earlier.

Sep 25, 2012 at 4:29 AM

Sorry, could you tell me how to use the latest code? Thank you so much.

Sep 25, 2012 at 7:41 AM

You can download the latest source code from the "Source Code" tab.

You can click on the "Download" button to get the latest source code or click on the specific changeset number to get the source code of that changeset.

For example, if you extracted the zip file to "c:\codeplex\cuite", then open CUITe.sln in Visual Studio 2010, build the Release Mixed Platforms configuration, and then reference the new CUITe.dll from "c:\codeplex\cuite\CUITe\bin\Release" from your project.