getting non-string values back from InvokejQueryFunction

10 posts, 0 answers
  1. Steve
    Steve avatar
    35 posts
    Member since:
    Jan 2011

    Posted 07 Jan 2015 Link to this post

    Below is some code that executes a jQuery function on a jstree control (see www.jstree.com for documentation on the jQuery control) - the jstree documentation says this function returns an array - I need WebAii to be able to return the array, or at least be able to parse the return from the jstree function, so it's more useful than the 'ToString()' that it calls on the returned object, which results in "System.__ComObject".  Set a breakpoint on the 'var foo' line, and inspect the value of foo to see what I mean.
    [TestMethod]
    public void jsTreeJive()
    {
        Manager Manager = new ArtOfTest.WebAii.Core.Manager(false);
     
        Manager.Start();
     
        Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
     
        Browser Browser = Manager.ActiveBrowser;
     
        Browser.NavigateTo("http://www.jstree.com/docs/interaction/");
     
        var foo = Browser.Find.ById<HtmlDiv>("jstree1").AsjQueryControl().InvokejQueryFunction("jstree('get_selected', 'true');");
     
        Manager.Dispose();
    }
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 12 Jan 2015 Link to this post

    Hello Steve,

    I have reproduced the scenario.

    Please elaborate a bit more what do you expect to achieve with calling this function? Please give us more detailed information so we can assist you.

    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
     
  3. Steve
    Steve avatar
    35 posts
    Member since:
    Jan 2011

    Posted 12 Jan 2015 Link to this post

    The jstree documentation says the return of the method 'get_selected' returns an array - I need to examine the contents of the array, as it will tell me which of the elements in the jstree are selected.
  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 15 Jan 2015 Link to this post

    Hi Steve,

    Have you tried this out of Test Studio. Does jstree('get_selected', 'true'); really return an array?

    Test Studio just call this function it doesn't store its results.

    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
     
  5. Steve
    Steve avatar
    35 posts
    Member since:
    Jan 2011

    Posted 03 Feb 2015 Link to this post

    According to their documentation, it returns an array.  I have no reason to doubt that it does exactly that.  I will try to use the javascript debugger in Chrome to see if I can actualy see that an array is returned, but doubt this exercise will prove otherwise.
  6. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 06 Feb 2015 Link to this post

    Hello Steve,

    Please take your time and update this ticket accordingly.

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  7. Steve
    Steve avatar
    35 posts
    Member since:
    Jan 2011

    Posted 06 Feb 2015 Link to this post

    This is what their documentation says about the get_selected function:

    http://www.jstree.com/api/#/?f=get_selected([full])

    All of their methods/functions that return a string work perfectly with InvokejQueryFunction - the ones that return something other than a string return what I showed you in the code above.  I would very much like WebAii to be able to return something other than 'System.__ComObject' when these methods are called.

  8. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 11 Feb 2015 Link to this post

    Hello Steve,

    Unfortunately jQueryControl.InvokejQueryFunction Method returns only a string. Here is our API documentation.

    This method is designed for just calling the function and not storing it.

    Thank you for your understanding.

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  9. Steve
    Steve avatar
    35 posts
    Member since:
    Jan 2011

    Posted 11 Feb 2015 Link to this post

    OK - I added feedback in the feedback portal asking that this be addressed, as it is very limiting to only be able to get back a string (as demonstrated in the above code...)
  10. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 16 Feb 2015 Link to this post

    Hello Steve,

    Thank you for adding this.

    Hope this will be done as soon as possible.

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top