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

Button Not Found KnockoutJs

1 Answer 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
jwize
Top achievements
Rank 1
jwize asked on 21 Jul 2015, 09:13 PM

 

I have an issue where knockoutjs is showing and hiding a button using an data-bind="if: [condiition]" statement.

The button is initially not shown(ie. the if evaluates to false). The Find.ById doesn't find the button even after the if statement evaluates to true and shows the item. Is this a limitation or should I be able to find the element after the runtime update. 

 

Does the code in test studio get dynamically created at page load time or is the DOM in the browser searched whenever one of these Find.By... functions is executed? If the latter is true I will never be able to get a handle to my element in my test. 

I have also confirmed that the instance of button is located if I remove the show/hide IF knockoutjs statement . 

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 24 Jul 2015, 02:18 PM
Hello Jaime,

Find() method is not created dynamically it looks for the element in the current DOM. It may happen that the DOM is not fully loaded hence Test Studio is not able to find the element.

In that case you can add WaitForExists step for the particular element which refreshes the DOM.

Another option is to add a coded step which refreshes the DOM:

ActiveBrowser.RefreshDomTree();

If the issue persists please:

1. Send us a screen shot of that button and its DOM.

2. A short Jing video would also help us better understand the issue.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
jwize
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or