내가 수행하고있는 프로젝트는 봇과 같은 것으로 응용 프로그램의 프로세스 (일부 자동 q & 테스트 용)를 가져 와서 값을 추가하고 응용 프로그램에서 값을 편집합니다 출력이 예상대로되는지 확인하십시오.표 셀에 ComboBox 값 설정 C#
음, 응용 프로그램 창 (창)을 가져 왔는데 다른 응용 프로그램에 추가 된 DataGridView 항목을 얻으려고합니다. 나는 그것이 "DataGridView1"이라는 것을 알고 있고, (SpecFlow와 White.Core) 사용하고있는 UI 인터페이스는 다른 응용 프로그램에서 DataGridView 항목을 가져 오는 것을 지원하지 않는다.
해결 방법으로, 나는 DataGridView 항목을 테이블로 잡았다. . 이제 문제가 발생했습니다. 해당 셀 에 선택을 지원하지 않는 ComboBox가 포함 된 데이터 표보기에서 셀 값을 설정하려고합니다. 매번 Cell.SetValue (문자열)을 수행 할 때마다 값을으로 설정합니다. 내 UI를 탐색 할 때까지
기본적으로 내 질문은, 내가 테이블 셀의 값을 설정할 수있는 방법이 있습니까? 콤보 상자가 포함 된 DataGridView 셀이되어야합니까? 나는 Q & 자동화를 들어
public void InsertValues(String price, String name)
{
//actually is the following
//DataGridView Data = window.Get<DataGridView>("dataGridView1");
//but this is not supported by the White.Core.UIItems.
Table Data = window.Get<Table>("dataGridView1");
int numRows = 0;
foreach (White.Core.UIItems.TableItems.TableRow tbr in Data.Rows)
numRows++;
//get the last row in the table
White.Core.UIItems.TableItems.TableRow leaseRow = Data.Rows[numRows - 1];
White.Core.UIItems.TableItems.TableCell PriceCell = leaseRow.Cells["price_val"];
White.Core.UIItems.TableItems.TableCell NameCell = leaseRow.Cells["name_val"];
//set the values of the various cells in the table
PriceCell.Click();
PriceCell.SetValue(pricingFormulaName);
PriceCell.Enter(pricingFormulaName);
NameCell.Click();
NameCell.SetValue(feeScheduleName);
NameCell.Enter(feeScheduleName);
}