js 및 html 코드의 모양에 따라 다릅니다. 그것은 그렇게 간단하지 않습니다. WaitUntil...
방법을 사용해보십시오.
작업이 완료되면 id가 foo
인 새 div 요소가 나타납니다. 기다리려면 다음 코드를 사용하십시오.
ie.Div("foo").WaitUntilExists();
가끔은 그렇게 간단하지 않습니다. 예를 들어 작업이 끝나면 테이블 내용이 변경됩니다. 이전 행이 제거되고 새 행이 나타납니다. 일치하는 경우 :
//Get cell reference
var cell = ie.Table("bar").OwnTableRow(Find.First()).OwnTableCell(Find.First());
var cellRef = cell.GetJavascriptElementReference();
//Change text of that cell using javascript. jQuery could be used if it's used on that page
//If you are 100% sure, that something will change, just assign cell.Text to text. If so, you don't even
//need cellRef
var text = "Dummy text or random or whatever";
ie.RunScript(cellRef + ".childNodes[0].nodeValue = '" + text + "'");
//TODO:
//Do something here to fire ajax request
//Wait until table will be updated, ie. wait until first cell will not contains assigned dummy text.
//This could be done in many ways.
ie.Table("bar").WaitUntil(t => t.OwnTableRow(Find.First()).OwnTableCell(Find.First()).Text != text);
//or just:
//cell.WaitUntil(c => c.Text != text), but maybe it will not work in your case
어쨌든, 이것은 단지 몇 가지 팁입니다. 거의 항상 고통 스럽기 때문에 실제 코드를 표시하지 마십시오.)
나는 당신이 대략적으로 설명한 것과 비슷한 것을했습니다. 완료시 요소에 속성을 추가했습니다. Watin에서 기다립니다. – aknuds1