Telerik Forums
Testing Framework Forum
3 answers
186 views
Hi,

Starting with the examples supplied I made a small test, just loading a page that needs a logon, enter some text in a text box and click on a button to make a search.

It works on IE(9) and Firefox(latest) but in Chrome the logon box remains with both fields empty and the test fails with an error that it fails to find the control.

It's like it doesn't detect the logon dialog.

Thanks in advance, here is the code:

Settings mySettings = new Settings();
 
mySettings.Web.DefaultBrowser = browser;
  
Manager myManager = new Manager(mySettings);
  
myManager.Start();
  
myManager.LaunchNewBrowser();
  
myManager.DialogMonitor.AddDialog(LogonDialog.CreateLogonDialog(myManager.ActiveBrowser, "username", "password", DialogButton.OK));
myManager.DialogMonitor.Start();
 
myManager.ActiveBrowser.NavigateTo("url");
  
Element linkSearch = myManager.ActiveBrowser.Find.ByContent("Search");
myManager.ActiveBrowser.Actions.Click(linkSearch);
  
Element editSearch = myManager.ActiveBrowser.Find.ById("ctl00_ctl00_ContentPlaceHolderMain_txtSearch");
myManager.ActiveBrowser.Actions.SetText(editSearch, "Example");
 
Element radioCompanies = myManager.ActiveBrowser.Find.ById("ctl00_ctl00_ContentPlaceHolderMain_rbtnListFilterType_0");
myManager.ActiveBrowser.Actions.Check(radioCompanies, true);
 
Element buttonSearch = myManager.ActiveBrowser.Find.ById("ctl00_ctl00_ContentPlaceHolderMain__btnSearch");
myManager.ActiveBrowser.Actions.Click(buttonSearch);
 
Element linkResult = myManager.ActiveBrowser.Find.ByContent("Example");
myManager.ActiveBrowser.Actions.Click(linkResult);
 
myManager.Dispose();
Boyan Boev
Telerik team
 answered on 30 Aug 2013
7 answers
165 views
hi, i have tried everything that i find in forums and so on and i have stuck. I can not save selected option from select (drop down). Developers are using angularJs framework (Javascript-based). Events, SelectByText, Desktop.Mouse.Click and so on didn't helped....

Currently my code looks like this:

Browser.RefreshDomTree();
var select = Browser.Find.ByAttributes<HtmlSelect>(attributes);
select.MouseClick();
Thread.Sleep(Extensions.SmallTimeOut);
Browser.RefreshDomTree();
select = Browser.Find.ByAttributes<HtmlSelect>(attributes);
var option = select.Options.First(itm => itm.Text.Equals(value));
option.Click();

Boyan Boev
Telerik team
 answered on 29 Aug 2013
5 answers
119 views
Hi guys,

It looks like support for latest Firefox 22 is broken. I didn't find any issues related in PITS so I decided to write here.

I am using latest released Telerik Testing Framework 2012.2.1420 with bundled Firefix Http Client 2012.2.1205 add-on.
Rolling back to previous Firefox 21 solves this issue. 

The problem can be simply reproduced with following code:

ActiveBrowser.NavigateTo("http://www.google.com");
ActiveBrowser.Find.ByName<HtmlInputText>("q").Text = "telerik";
ActiveBrowser.Find.ByName<HtmlButton>("btnK").Click();


Exception occurs:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!
InError set by the client. Client Error:
mozCommandProcessor: A DOM click on the target element threw an error. TagName: BUTTON Err: TypeError: Value does not implement interface WindowProxy.
BrowserCommand (Type:'Action',Info:'NotSet',Action:'Click',Target:'ElementId (tagName: 'button',occurrenceIndex: '1')',Data:'',ClientId:'8f9b7a8f-06cc-4edb-8ce9-d925a17e60bf',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'mozCommandProcessor: A DOM click on the target element threw an error. TagName: BUTTON Err: TypeError: Value does not implement interface WindowProxy.')
InnerException: none.

Hope to see it fixed in the upcoming release.
Thank you in advance.








Doug
Top achievements
Rank 1
 answered on 28 Aug 2013
3 answers
216 views
Hello,

I've been automating tests for a specific website for some time now. Today I've added and updated some of my previous tests in order for them to work in a future release of the website. When doing this I stumbled across a rather peculiar problem: my newly added test steps do not seem to always wait for the browser to be ready.

This is quite unpleasant, as the website is designed to return warnings / alert boxes every single time the user tries to initiate an action while the website is still loading / working on the previous "user request" so to speak. This means I have to add in a lot of extra alert dialog handlers.

I've never had similar problems before in my ~11 months of experience developing tests for this particular website. To add to the mystery:

- The tests that I've been modifying are spread out through multiple visual studio solutions. The odd behaviour is only being displayed in 1 out of 8 solutions, the others are still fine.
- There's nothing special about the added steps. Ajax is set to 0, WaitOnElements for each step is true, SimulateRealClick is set to false.
- It seems to be consistent behaviour, meaning that it always goes wrong at the same steps.
- All the steps that were recorded prior to today still work fine.
- Removing / re-recording the steps doesn't fix the issue.
- I did specifically raise the 'Wait on elements timeout' at the 'Quick execution options' from 10000 to 30000. Changing it back didn't have an effect on the behaviour, so this likely isn't the cause of the problem.
- I tried going back to IE9 (worked with IE10 before). This didn't fix it either.

Installed version: 2012.2.1204.0

I'm about to just revert my test back to the way it was and start all over. I'm hoping there's something I might have missed. Hope you can help me out!

Kind regards,

Arnout
Boyan Boev
Telerik team
 answered on 28 Aug 2013
1 answer
129 views
Hello,

I am seeing this exception come up randomly when logging into my company's test website. It seems to be caused/related to the Firefox Confirm Dialog although no dialog comes up on login. This started occurring after upgrading to the newest telerik framework version, 2013.1.806.0. Stopping the dialog monitor seems to fix the problem but some of our tests need this running.

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Runtime.InteropServices.COMException: Object is not connected to server (Exception from HRESULT: 0x800401FD (CO_E_OBJNOTCONNECTED))
10:39:52 at Accessibility.IAccessible.get_accChildCount()
10:39:52 at MS.Internal.AutomationProxies.Accessible.GetChildCount(IAccessible acc)
10:39:52 at MS.Internal.AutomationProxies.Accessible.GetChildren(IAccessible parent)
10:39:52 at MS.Internal.AutomationProxies.Accessible.SetAccessibleChildrenIndexAndGetChildren(IAccessible parent)
10:39:52 at MS.Internal.AutomationProxies.MsaaNativeProvider.System.Windows.Automation.Provider.IRawElementProviderFragment.GetRuntimeId()
10:39:52 at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
10:39:52 at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
10:39:52 at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr)
10:39:52 at MS.Internal.Automation.UiaCoreApi.UiaNavigate(SafeNodeHandle hnode, NavigateDirection direction, Condition condition, UiaCacheRequest request)
10:39:52 at System.Windows.Automation.AutomationElement.Navigate(NavigateDirection direction, Condition condition, CacheRequest request)
10:39:52 at System.Windows.Automation.TreeWalker.GetFirstChild(AutomationElement element)
10:39:52 at ArtOfTest.Common.Extensions.AutomationExtensions.GetControlChildrenCount(AutomationElement element)
10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.FirefoxConfirmDialogMatch..ctor(AutomationElement dialog)
10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.ConfirmDialog.MatchesUIAutomationElement(AutomationElement element)
10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.<>c__DisplayClass8.<FindUIAEDialog>b__5(IDialogUIAutomation d)
10:39:52 at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.FindUIAEDialog(AutomationElement element)
10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.HandleElement(AutomationElement element)
10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.AutomationEvent_OnStructureChanged(Object sender, StructureChangedEventArgs e)
10:39:52 --- End of inner exception stack trace ---
10:39:52 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
10:39:52 at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
10:39:52 at System.Delegate.DynamicInvokeImpl(Object[] args)
10:39:52 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
10:39:52 at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
10:39:52 at System.Windows.Threading.DispatcherOperation.InvokeImpl()
10:39:52 at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
10:39:52 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
10:39:52 at System.Windows.Threading.DispatcherOperation.Invoke()
10:39:52 at System.Windows.Threading.Dispatcher.ProcessQueue()
10:39:52 at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
10:39:52 at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
10:39:52 at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
10:39:52 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
10:39:52 at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
10:39:52 at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
10:39:52 at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
10:39:52 at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
10:39:52 at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
10:39:52 at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
10:39:52 at ArtOfTest.Common.DispatcherFactory.<>c__DisplayClass2.<CreateDispatcher>b__0()
10:39:52 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
10:39:52 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
10:39:52 at System.Threading.ThreadHelper.ThreadStart()

Cody
Telerik team
 answered on 26 Aug 2013
1 answer
53 views
What kind changes has been release with 2013.1 806 (Aug 6, 2013)  version?
Cody
Telerik team
 answered on 26 Aug 2013
3 answers
93 views
I have an HtmlListItem with the following innerText:

Emergency Override ConfidentialEmergency Medical CareQualified Service OrganizationPatient conscious, hystericalTo avert serious threats to health or safetyPursuant to reporting of abuse, or violencePursuant to Public Health ActivitiesPursuant to law enforcement activitiesPursuant to activities of Medical Examiner

This property is coming from it's child HtmlUnorderedList with it's children HtmlListItems.  Its parent is an HtmlUnorderedList.  If I do the following, the find works:

HtmlUnorderedListObject.Find.ByContent<HtmlListItem>("Emergency Override ConfidentialEmergency Medical CareQualified Service OrganizationPatient conscious, hystericalTo avert serious threats to health or safetyPursuant to reporting of abuse, or violencePursuant to Public Health ActivitiesPursuant to law enforcement activitiesPursuant to activities of Medical Examiner", FindContentType.InnerText);


But, doing the following does not:
HtmlUnorderedListObject.Find.ByContent<HtmlListItem>("p:Emergency Override Confidential", FindContentType.InnerText);

Is the space in the partial string throwing the Find off?

Mario
Telerik team
 answered on 22 Aug 2013
3 answers
185 views
Hi,

I am creating a smoke test and seeing some behavior with the RadComboboxs. I need to automate one being opened. Is there a recommended way to do this?

I've tried ToggleDropDown but on occasion I get 'Object reference not set to an instance of an object' originating from Telerik.WebAii.Controls.Xaml.Wpf.RadComboBox.ToggleDropDown().

I've also tried trying if the combobox has items and then doing SelectItem(0, true) but, this gives me the following error when it tries to automate on a combobox from the filter popups on the grids.

System.Exception: Was not able to match a segment within the path. Expected:decorator , Found:FrameworkElement , Path:/popuproot:-1:11962631/decorator:0:40554822/nonlogicaladornerdecorator:0:29449080/contentcontrol:0:29534370/contentpresenter:0:23828523/filteringcontrol:0:13130117/border:0:51062193/grid:0:56906561/stackpanel:0:42397005/stackpanel:1:20897776/radcombobox:3:29186801
   at ArtOfTest.WebAii.Silverlight.VisualFind.ByReference(AutomationReference reference, Boolean throwIfNotFound)
   at ArtOfTest.WebAii.Silverlight.FrameworkElement.Refresh()
   at Telerik.WebAii.Controls.Xaml.Wpf.RadComboBox.ToggleDropDownIfRequested(Boolean openDropDown)
   at Telerik.WebAii.Controls.Xaml.Wpf.RadComboBox.SelectItem(Int32 itemIndex, Boolean openDropDown)
   at Telerik.WebAii.Controls.Xaml.Wpf.RadComboBox.SelectItem(Int32 itemIndex)

Any ideas?

I'm using version 2012.2.1527.0.
Thanks
Andrea
Boyan Boev
Telerik team
 answered on 22 Aug 2013
3 answers
131 views
Hello,
I am trying to do something simple like trying to the sample webaii test to launch its browser and complete its test by going to wikipedia and type in test studio and click go and confirm that it appears.

So from what I am experiencing, I have my work computer that has Test Studio on it and I used the sample test on it.  When I have it run, it rans completely fine as expected.

But on my home computer and a virtual machine, (Windows 8 with Visual Studio Professional) when the test starts to launchnewbrowser(), it hangs there and does nothing until it gets the timeoutexception. 

Is this happening to anyone else?
Cody
Telerik team
 answered on 22 Aug 2013
1 answer
61 views
Hi,

I'm quite new to Testing frameworks, just going to jump into.
For now, i'd like to play with WP feature: isolated storage. I'd like to have some tests about files/folders creation/deletion.
Is it possible to write some test cases using Testing Framework?

EDIT: looking like, it is not supported - lets reformulate question "is WP planned to be supported in the future?"
Boyan Boev
Telerik team
 answered on 21 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?