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

getting non-string values back from InvokejQueryFunction

9 Answers 28 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 07 Jan 2015, 06:47 PM
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();
}

9 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 12 Jan 2015, 02:06 PM
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
 
0
Steve
Top achievements
Rank 1
answered on 12 Jan 2015, 09:57 PM
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.
0
Boyan Boev
Telerik team
answered on 15 Jan 2015, 01:18 PM
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
 
0
Steve
Top achievements
Rank 1
answered on 03 Feb 2015, 09:59 PM
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.
0
Boyan Boev
Telerik team
answered on 06 Feb 2015, 12:22 PM
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
 
0
Steve
Top achievements
Rank 1
answered on 06 Feb 2015, 01:53 PM
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.

0
Boyan Boev
Telerik team
answered on 11 Feb 2015, 08:30 AM
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
 
0
Steve
Top achievements
Rank 1
answered on 11 Feb 2015, 06:29 PM
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...)
0
Boyan Boev
Telerik team
answered on 16 Feb 2015, 08:38 AM
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
 
Tags
General Discussions
Asked by
Steve
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Steve
Top achievements
Rank 1
Share this question
or