Button Not Found KnockoutJs

2 posts, 0 answers
  1. jwize
    jwize avatar
    66 posts
    Member since:
    Mar 2013

    Posted 21 Jul 2015 Link to this post


    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 . 

  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 24 Jul 2015 Link to this post

    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:


    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.

    Boyan Boev
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top