i have used Telerik testing framework to create regression test. i am also using that regression test to perform security testing(First regression testing then security testing in same unit test).
But since Telerik framework automatically closes the browser when test finishes. But for security testing i need the browser opened till security test finishes.
I know there is a "RecycleBrowser" web setting which allows to open a browser till its manager instnace is not disposed, but that is not working for me as expected. It closes the browser after waiting for some time. I want the browser to remain open all the time and it only closes if some manually try to close it.
Let me know if it is possible using telerik framework.
Hi there,
I am using Telerik for a while for web testing. Up until now I was using to test only with a single tab in browser.
Now I am facing a problem that I cannot create multiple tabs, navigate through tabs programmatic.
Can someone give me a simple example of how to open 1 browser, create 3 tabs and to retrieve the HtmlControls from each tab?
Note: Right now the creation of the tabs and navigation i'm doing it via Hotkeys, a problem I have is that I'm not able to get the HtmlControls from the second and third tab.
Thanks!
Hello! I am having some trouble with the Manager.Desktop.KeyBoard.TypeText() method. I recorded an action that inserts data into a field as so:
// Enter text '1.01' in 'SSLCERTEVSSLSummarySinglePriceText'
Actions.SetText(Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummarySinglePriceText, "");
Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummaryServicePriceText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
ActiveBrowser.Window.SetFocus();
Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummaryServicePriceText.Focus();
Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummaryServicePriceText.MouseClick();
Manager.Desktop.KeyBoard.TypeText("1.01",100);
However the text is not being set in the field. My first attempt at solving was problem was noting that the recorded action was attempting to set the data twice in this code block:
-Actions.SetText(Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummarySinglePriceText, "");
-Manager.Desktop.KeyBoard.TypeText("1.01",100);
So I commented out the last 5 lines and ended up with:
Actions.SetText(Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummarySinglePriceText, "");
and inserted my data between the blank quotations. This did not work either, because data was being set on the text field yet upon proceeding, valdiation did not recognize text in the box as if it was blank.
Any help here would be appreciated, if anyone needs more info on how to solve this problem please let me know, thanks!
Hello,
Whever I use Desktop.Keyboard.Keypress, it tries to send the keys to Vidual Studio, instead of the browser being run by Manager.
However, Desktop.Mouse.Click sends its events to the browser. Has anyone had the same issue?
I tried paying with manager instances but it did not help:
Instance.Desktop.KeyBoard.TypeText("google.com");
Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Tab, 1000);
My mouse click code is:
Instance.Desktop.Mouse.Click(MouseClickType.LeftClick, urlCell.GetRectangle());
Hi all,
I have been dealing with this problem for a while now and im not sure why my program is functioning this way. Whenever I try to click a button on a "pop-up", the automation will click the upper left of the screen, even though the button is near the center of the screen. The "pop-up" is not a new window btw, it is just something that is on the screen. Me and my coworkers are able to automate the other "pop-ups" we use just fine. For some reason though, this one is behaving differently.
Heres the HTMLbutton that im trying to target:
1.
<
div
class
=
"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"
>
2.
<
div
class
=
"ui-dialog-buttonset"
>
3.
<
button
type
=
"button"
id
=
"OK"
class
=
"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
role
=
"button"
>
4.
<
span
class
=
"ui-button-text"
>OK
5.
</
span
>
6.
</
button
>
7.
</
div
>
8.
</
div
>
So I was wondering, is there like a premade function for clicking coordinates on the window? or would there be a different way i could approach this?
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!
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
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