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

RefreshDomTree seems not work

1 Answer 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ariel
Top achievements
Rank 1
Ariel asked on 12 Mar 2014, 08:40 PM
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.


1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 17 Mar 2014, 03:55 PM
Hi Ariel,

Thank you for contacting us.

Please elaborate a bit more on your scenario and what is the actual problem. What do you mean by it is validated OK in the UO but when you review in the log you still read the previous text?

Give us some more detailed information (e.g. screen shots, video, log).

You can try to make the click in step 5 a real one: btnShowDates.MouseClick(); 

Does this help?

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Ariel
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or