Telerik Forums
Testing Framework Forum
6 answers
177 views

Invoke blur event is failing to execute in IE 11 for Test studio latest version 2016.2. It worked fine in earlier version of test studio across all the browser. I need to invoke this event for invoking call to a webservice. Can anybody help me in resolving this issue.

 

 

'7/11/2016 2:54:08 PM' - 'Fail' : 64. Invoke 'OnBlur' event on 'C1C3QUELICENSENUMBERText'
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
ExecuteCommand failed!
InError set by the client. Client Error:
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, BrowserCommand command)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommandInternal(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeEvent',Target:'ElementId (tagName: 'input',occurrenceIndex: '74')',Data:'onblur--@@--null',ClientId:'Client_007162c7-bb26-4f8e-a68b-32c177fccba3',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'0',InError:'True',Response:'System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, BrowserCommand command)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommandInternal(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

InnerException:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, BrowserCommand command)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommandInternal(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeEvent',Target:'ElementId (tagName: 'input',occurrenceIndex: '74')',Data:'onblur--@@--null',ClientId:'Client_007162c7-bb26-4f8e-a68b-32c177fccba3',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'0',InError:'True',Response:'System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, BrowserCommand command)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommandInternal(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Actions.InvokeEvent(Element targetElement, ScriptEventType eventType)
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.InvokeEventActionDescriptor.Execute(Browser browser)
   at ArtOfTest.WebAii.Design.Extensibility.HtmlActionDescriptor.Execute(IAutomationHost autoHost)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
------------------------------------------------------------
'7/11/2016 2:54:08 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'7/11/2016 2:54:08 PM' - Overall Result: Fail
'7/11/2016 2:54:08 PM' - Duration: [1 min: 19 sec: 4 msec]
------------------------------------------------------------
'7/11/2016 2:54:09 PM' - Test completed!

Konstantin Petkov
Telerik team
 answered on 29 Aug 2016
3 answers
199 views
When I click on the link in the Silverlight application mene should open a new html page, but instead opens another page with the headline "blank page". This happens on a clean windows server 2012 r2 in IE11. In win8 IE11 and other browsers it does not happen. I've tried a lot of options and they did not fit me. I set up on the basis of the article (http://docs.telerik.com/teststudio/user-guide/configure-your-browser/internet-explorer.aspx). Can someone faced with this problem? How can I fix this problem? What settings should be included in the IE? Thanks in advance.
Boyan Boev
Telerik team
 answered on 23 Aug 2016
5 answers
166 views

Hi,

i have written a script to collect menu paths from a menu in a silverlight application. The menus are shown\added on demand to the menu tree (when someone hovers or click the parent menu, only then sub menus are loading to the DOM tree), so i need to refresh the DOM tree at regular interval. One more thing to note that the size of DOM also getting increased as we going on opening new menus and their sub menus.

 

Below is the code i am using to collect the menu paths.

 

01./// <summary>
02.        /// Find all available menu paths.
03.        /// </summary>
04.        /// <returns>Returns collected menu paths.</returns>
05.        public override List<MenuPath> CollectPaths()
06.        {
07.            List<FrameworkElement> mainMenuItems = RootElement.Find.AllByExpression(new XamlFindExpression("xamltag=oatimiddleclickmenuitem")).ToList();
08.List<MenuPath> menuPaths = new List<MenuPath>();
09.    menuPaths = CollectMenuPaths(filteredMenuItems, MenuPath.EmptyPath, 1);
10.    return menuPaths;
11.}
12. 
13./// <summary>
14.        /// Collect menu paths by finding the controls inside the DOM tree.
15.        /// </summary>
16.        /// <param name="menuItems">Collection of main menu items.</param>
17.        /// <param name="currentPath">current path.</param>
18.        /// <param name="menuPaths">collection of collected menu paths.</param>
19.        /// <returns></returns>
20.        private List<MenuPath> CollectMenuPaths(List<FrameworkElement> menuItems, MenuPath currentPath, int level)
21.        {
22.            List<MenuPath> pathList = new List<MenuPath>();
23.            foreach (FrameworkElement menuListItem in menuItems)
24.            {
25.                FrameworkElement menuItemTextBlock = menuListItem.Find.ByExpression(new XamlFindExpression("xamlTag=grid", "|", "xamlTag=textblock"));
26.                if (menuItemTextBlock != null && !string.IsNullOrEmpty(menuItemTextBlock.TextLiteralContent))
27.                {
28.                    if (menuItemTextBlock.TextLiteralContent == "MRTU")
29.                    {
30.                        Console.WriteLine("Mine");
31.                    }
32.                    MenuPath currentMenuPath = currentPath.Append(new MenuId(menuItemTextBlock.TextLiteralContent));
33.                    FrameworkElement expandIcon = menuListItem.Find.ByExpression(new XamlFindExpression("xamlTag=path", "name=#ExpandIconBackground|ExpandIconForeground"));
34.                    if (level == 1 || expandIcon != null)
35.                    {
36.                        menuListItem.EnsureClickable();
37.                        menuListItem.User.HoverOver();
38.                        Playback.Wait(100);
39.                        Plugin.OwnerApp.RefreshVisualTrees(); //Refreshing silverlight visual tree.
40.                        Playback.Wait(100);
41.                        menuListItem.Refresh();
42.                    }
43.                    List<FrameworkElement> innerMenuItems = menuListItem.Find.AllByExpression(new XamlFindExpression("xamltag=oatimiddleclickmenuItem")).ToList();
44.                    if (innerMenuItems.Count > 0)
45.                    {
46.                        pathList.AddRange(CollectMenuPaths(innerMenuItems, currentMenuPath, level + 1));
47.                    }
48.                    else
49.                    {
50.                        pathList.Add(currentMenuPath);
51.                    }
52.                }
53.            }
54.            return pathList;
55.        }

 Its working fine for me when we have small menus (let say less then 500 menu paths under the main menu). But when we have larger menus (say more then 500 to 5000 menu paths under the main menu) ,

In that case in the start of the menu scraping it works fine, but as we progressing its performance getting worsts (as DOM tree size also increasing simultaneously) and at a certain point it throwing me : "OutOfMemoryException" in System.dll at line no - 41 (menuListItem.Refresh()).

I tried to copy the Visual Tree at the time of exception and found that the size of visual tree text is of 2.5MB file.

 

Note : I am runiing it on a dedicated automated system with 16GB of memory.so i have enough memory for this. This script is a part of our  regression solution, so we have to run it over on any system whether large or small. i want to make it such that it can work on a large menu as well.

Please look into this ASAP.

 

Thanks & Regards

Vinay

 

 

 

 

Boyan Boev
Telerik team
 answered on 15 Aug 2016
1 answer
106 views

I am sure that I am just missing a setting, but I need to be able to manually login to a website and it requires 2 factor authentication. When the screen pops up, it closes about 1 second later before I can select my active key. I tried just clicking on the About Internet Explorer button once the browser was launched and had the same results.

 

I am just using the lines of code used in the getting started lesson:

Settings mySettings = new Settings();
mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
Manager myManager = new Manager(mySettings);
myManager.Start();
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo("Http://www.google.com");

 

Once the browser is active, click on the gear and then the About Internet Explorer. The window pops up and immediately closes.

 

Thanks in advance for your help.

 

Kevin Stone

Lead Software Engineer

Nikolay Petrov
Telerik team
 answered on 10 Aug 2016
4 answers
700 views
I've been automating tests for a specific website for some time now. I am using Testing Framework Version 2014.2.618.0 Free Edition with c# for chrome browser.
I am having trouble getting an iFrame element and elements within it from one of the pages.
Html structure is the following:
<div id="rightContainer" role="main">
<section class="application-plugin using-bootstrap"></section>
<iframe scrolling="no" allowtransparency="true" class="application-plugin-iframe" allowfullscreen="true" style="width: 100%; overflow: hidden; height: 928px;" src="http://plugins/application...">
#document
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
<div id="PluginTarget" "></div>
<div class="plugin-landing-page ">
<div class="plugin-landing-page-tiles clearfix ">
::before
<div class="col-md-4 col-sm-4 plugin-program-container ">
<div class="plugin-program "></div>//I want to click at this element
</div>
<div class="col-md-4 col-sm-4 plugin-program-container ">...</div>
</div>  
</body>
</html>
</iframe>                                 
</section>
<div style="display:none; "></div>
</div>


Note that ‘#document’ is a shadow DOM element.
What I tried so far to access the iFrame:
1)
Manager.ActiveBrowser.Frames.RefreshAllDomTrees();
Manager.ActiveBrowser.RefreshDomTree();
Manager.ActiveBrowser.Frames.WaitAllUntilReady();
int framesNumber = Manager.ActiveBrowser.Frames.Count;
Browser topFrame = Browser.Manager.ActiveBrowser.Frames["application-plugin-iframe"];
topFrame.RefreshDomTree();

topFrame is always null no matter how many times and in what sequence I’ve refreshed.
framesNumber is always null too.

2)

var topFrame = Manager.ActiveBrowser.Find.ByAttributes<HtmlControl>(string.Format("{0}={1}", "class", "application-plugin-iframe"));
Predicate<HtmlControl> filter = new Predicate<HtmlControl>((control) => control.Attributes.Any(a => a.Name == "class=" && a.Value=="plugin-program"));
var myBox =topFrame.Find.ByCustom<HtmlControl>(filter);

Using this approach I’m able to get the iFrame as HtmlControl or HtmlContainerControl element but myBox element is always null.

3)

var iFrame1 = Browser.Find.ByExpression("tagname=iframe");
var iFrameHtmlControl = new HtmlControl (iFrame1);
IUiSearchable searchable = new SearchableUiContext<HtmlControl>(iFrameHtmlControl);
searchable.Refresh();
HtmlControl result = searchable.Find.ByAttributes<HtmlControl>(string.Format("{0}={1}", "class", "plugin-program"));

Here again I’m able to get iFrame1 and iFrameHtmlControl elements and to Refresh but result is again null
4)
I tried getting the iframe
var topFrame = Manager.ActiveBrowser.Find.ByAttributes<HtmlControl>(string.Format("{0}={1}", "class", "application-plugin-iframe"));

And then getting all its child elements with a recursive method which is basically doing
allSubElements.AddRange(start.ChildNodes);
 for each child
I always get just one child element for topFrame - the Shadow DOM which doesn’t have children so here I figured out that the Shadow DOM element could be the cause of my problems but I’m not sure.

5)

Manager.ActiveBrowser.Actions.InvokeScript("$('body /deep/ #PluginTarget .plugin-program.click();");

This script worked when executed in Chrome Browser console but I need to click inside the Shadow DOM before. I still can’t do that from the test so executing JavaScript to click the desired element also failed.

As you can see I'm running out of ideas for this issue which is quite frustrating. Since the main logic of my app reside in that iFrame not being able to operate with it is a true deal breaker for me. 

Thank you in advance for any help.

Kind regards,

Elena
Telerik team
 answered on 10 Aug 2016
1 answer
141 views

I am facing an issue with Htmlspan clicking over a Menu Item. The issue is if I am using the below code (for example) it is working fine

 

HtmlSpan menu = manager.ActiveBrowser.Find.ByExpression<HtmlSpan>("tagname=span", "TextContent=~Management Process");

menu.Click(false);

 

But, when I am using this code it is not working

HtmlSpan menu = manager.ActiveBrowser.Find.ByExpression<HtmlSpan>("tagname=span", "TextContent=Management Process Dynamic");
menu.Click(false);

I am not able to understand why the exact TextContext is not working, I can't rely on the partial one, because multiple menu items can start with the same name (not now but may be in future). Please let me know if I need to change the Find Expression or I am missing something.

 

Regards,

Arvind Dhiman

Elena
Telerik team
 answered on 04 Aug 2016
11 answers
246 views

Hi,

 

In my project I have two tests, one for 'Accounts' and another for 'Advanced Find'

The 'Accounts' test has a coded step..

    public void SelectAccountTypeByName(String typeName, Browser xframe)
        {

 

 

dan
Top achievements
Rank 1
 answered on 29 Jul 2016
1 answer
143 views

I would like to test a grid (ASP.NET) with batch editing by using testing framework. To trigger the batch editing function, a user activate this with the mouse up event. If I use MouseClick(MouseLeftClick) or MouseClick(MouseLeftUp), the editing was not activated. Thank you for your help.

Nikolay Petrov
Telerik team
 answered on 28 Jul 2016
38 answers
2.0K+ views
Hello:

I am automating an application which has majority of the controls build using KendoUI such as
KendoGrid
Kendo Temaplate etc


Can you please help me how to identify these controls such as Kendo Grid and proceed further.Also please let me know Telerik Test tsudio completely supports Kendo UI controls or not.If not then from which version of test studio can we expect a complete support.

Thanks,
Naga
Boyan Boev
Telerik team
 answered on 27 Jul 2016
4 answers
300 views

I'd like to run my tests on a different server. Therefore I copied my project .exe along with all the .dll files to my server and started to run it.

Seeing as Firefox doesn't have the Telerik Test Studio Automation extension installed on my server the test just hang.

Therefore I'd like to install the extension, however where exactly does one download the extension? It doesn't seem to be available in the Firefox addon store nor any place else.

 

So my question is, from where do I download the Telerik Test Studio Automation extension for Firefox?

Elena
Telerik team
 answered on 18 Jul 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?