Hello,
I have a problem in a scrip test, so basically the scripts is:
1: foreach(HtmlControl e in searchResultsList) {
2: HtmlControl btnShowDates = e.Find.ByAttributes("class=~btn half-btn").As<HtmlControl>();
3: btnShowDateLabel = btnShowDates.BaseElement.InnerText;
4: if (btnShowDateLabel.Contains("Show Dates") && btnShowDates.IsVisible()){
5: btnShowDates.Click();
6: ActiveBrowser.RefreshDomTree();
7: HtmlControl btnHideDatesLabel = e.Find.ByAttributes("class=~btn half-btn").As<HtmlControl>();
8: btnHideDateLabel = btnHideDatesLabel.BaseElement.InnerText;
9: Log.WriteLine("Label :" + btnHideDateLabel + " after click on Show Dates")
10: }
After click in step 5, I added a RefreshDomTree(), because the label is displaying another text. For example before perform click on this element, the text is "Show Dates" and after click on it, the text is "Hide Dates". I validated that text changed well in the UI (during test execution) but when I review the log I am still reading the text previous to perform click, in this case "Show Dates" when I expected to read "Hide Dates". It sames like RefreshDomTree is not working. The test script run on FF and IE9.
Any suggestion improve the script?
Thanks.
Ariel.
I have a problem in a scrip test, so basically the scripts is:
1: foreach(HtmlControl e in searchResultsList) {
2: HtmlControl btnShowDates = e.Find.ByAttributes("class=~btn half-btn").As<HtmlControl>();
3: btnShowDateLabel = btnShowDates.BaseElement.InnerText;
4: if (btnShowDateLabel.Contains("Show Dates") && btnShowDates.IsVisible()){
5: btnShowDates.Click();
6: ActiveBrowser.RefreshDomTree();
7: HtmlControl btnHideDatesLabel = e.Find.ByAttributes("class=~btn half-btn").As<HtmlControl>();
8: btnHideDateLabel = btnHideDatesLabel.BaseElement.InnerText;
9: Log.WriteLine("Label :" + btnHideDateLabel + " after click on Show Dates")
10: }
After click in step 5, I added a RefreshDomTree(), because the label is displaying another text. For example before perform click on this element, the text is "Show Dates" and after click on it, the text is "Hide Dates". I validated that text changed well in the UI (during test execution) but when I review the log I am still reading the text previous to perform click, in this case "Show Dates" when I expected to read "Hide Dates". It sames like RefreshDomTree is not working. The test script run on FF and IE9.
Any suggestion improve the script?
Thanks.
Ariel.