Telerik Forums
Testing Framework Forum
1 answer
175 views
Hi Guys, 

I'm trying to write a simple test to find out whether a page is a read-only by checking if the attribute 'disable' is a part of a control's attribute (checkbox in this case).
I've got 3 disabled check-boxes on the page I'm testing. They look like this:
<input type="checkbox" disabled="disabled" name="assessmentForm:metCompletedPassedCourse" id="assessmentForm:metCompletedPassedCourse"/>

So I 'Collecting' all 3....
var checkBox = Manager.ActiveBrowser.Find.AllByAttributes<HtmlInputCheckBox>("type=checkbox");

And then try to verify that 'disable' is an existing attribute of each one of the check boxes elements. 
Assert.True(checkBox.All(item => item.Attributes.Contains( ?

Could you pls advice what is the iAttribute value as I'm not able to complete the above assertion....

Ta.


 
Stoich
Telerik team
 answered on 12 Jan 2011
3 answers
132 views
Hey guys,

Is there a way to refresh the browser window count (Manager.Browser.Count)?  I've run into a very intermittent problem where occasionally my tests will fail, because the browser count is wrong.  So in my code I want to do a quick check to see if the browser count is where it should be, and if it isn't, refresh the count and try again.

Alternatively, is there a "Wait For" new browser window to load function?  This could also solve the problem, as I think the above maybe related to a timing issue.

Thanks.
Stoich
Telerik team
 answered on 11 Jan 2011
3 answers
105 views
I use axwebbrowser before, so i want to change it become webAII, Question does it support mshtml ? so i don't need to change many codes ?

WaTin support MsHTML :), i hope webAII support too.

My codes now :

HTMLDocument Document =  (HTMLDocument)wb.Document;
              HTMLInputElement iptUserName = (HTMLInputElement)Document.getElementById("f_username");
                iptUserName.value = StaticClass.BLI.articlecellUser;

                HTMLInputElement iptPassword = (HTMLInputElement)Document.getElementById("f_password");
                iptPassword.value = StaticClass.BLI.articlecellPass;

                HTMLInputElement iptLogin = (HTMLInputElement)Document.getElementById("B7");
                iptLogin.click();
Cody
Telerik team
 answered on 06 Jan 2011
1 answer
122 views
Hi There

Have the error as attached in the screen and cannot start the recorder.

Please Help

Nick
Cody
Telerik team
 answered on 06 Jan 2011
1 answer
116 views
Hi,

Here is the scenario where i have to search for an element in the combobox.

an element - value being a string.

I am using HtmlSelect control for combobox.
but htmlSelectControl.Option.Contains( "is accepting an HtmlOption ")

how do i convert a string to a HtmlOption object??

Stoich
Telerik team
 answered on 05 Jan 2011
3 answers
112 views
I've used the Dialog(DialogButton.OK) before but I have a question on how to use the DialogAttribute with the IDialog customDialog constructor. 

[TestMethod]
[Dialog(new ConfirmDialog(Manager.Current.ActiveBrowser, DialogButton.OK))]
public void TestCase()
{
     // This gives me an error. "An attribute argument must be a constant expression, typeof expression or array creation                      expression of an attribute parameter type
}

So my question is since attributes require constant expressions for their arguments how does the DialogAttribute work for "Custom" dialog handling?

Cody
Telerik team
 answered on 31 Dec 2010
2 answers
90 views
I am playing around with the framework and I was just wondering why there is a Find.ById() but not a Find.AllByClass<T>() or Find.AllByClass()?

Am I missing something whats the best way to figure something out like this? Should I just create an extension method using some other method?
Stoich
Telerik team
 answered on 23 Dec 2010
1 answer
162 views
Hi,

I am trying to execute the webAii sample test - Helthcaredemo but it is failing(eventhough it is launching IE) with following message:
I am trying to run this from XP having IE6 installed on it.


Test method QuickStarts_VSTS_CS.SilverlightHealthcareSample.HealthCareDemo threw exception:  System.ApplicationException: Exception thrown attempting to launch Internet Explorer. Please make sure Internet Explorer is properly installed and you are able to launch it. --->  System.TimeoutException: Wait for condition has timed out.

The stack trace is:
ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Int32 timeout)
ArtOfTest.Common.Win32.WindowManager.Attach(IntPtr& handle, Boolean findTabWindow, Boolean loadClr, IntPtr& hookId)
ArtOfTest.Common.Win32.WindowManager.Attach(IntPtr& handle, Boolean findTabWindow, Boolean loadClr)
ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)
ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle)
QuickStarts_VSTS_CS.SilverlightHealthcareSample.HealthCareDemo() in C:\Program Files\Telerik\WebAii Testing Framework 2010.3\Samples\WebAii Framework\QuickStarts_VSTS_CS\Tests\SilverlightHealthcareSample.cs: line 136

The debug trace is:
[4:01 PM] - Using: ArtOfTest.Common, Version=2010.3.1213.0, Culture=neutral, PublicKeyToken=14a0200bfcbb7b62
[4:01 PM] - OS: Microsoft Windows NT 5.1.2600 Service Pack 3
[4:01 PM] - Locating ArtOfTest.Connector.dll
[4:01 PM] - Loading C:\Program Files\Telerik\WebAii Testing Framework 2010.3\Bin\ArtOfTest.Connector.dll
[4:01 PM] - Loading _HookProc@12
Stoich
Telerik team
 answered on 23 Dec 2010
3 answers
155 views
I'm trying to move from a windows xp build server to windows 7 64bit. We have a set of unit tests that are run via nunit that fire up a browser using webaii and control a sliverlight application and work correctly on the old build server.

When we moved to the new server, the build can fire up the browser and navigate to the right page, but cant click buttons to control the browser and run the tests. The tests work correctly when running from visual studio, resharper unit test runner.

- I'm using webaii version 2010.2.1007
- It is a silverlight 4 application
- I have turned off UAC in windows 7

What if any IE 8 settings should I be checking?
What other things should I be checking?
Cody
Telerik team
 answered on 23 Dec 2010
5 answers
227 views
Hi,
I am using  [Dialog(DialogButton.OK)] in my test method.
using DialogButton.OK i want to click 'OK' in  JavaScript confirm dialog but it always click cancel in JavaScript confirm dialog.When i use 
Manager.DialogMonitor.AddDialog(new AlertDialog(ActiveBrowser, DialogButton.OK));
Manager.DialogMonitor.Start();

it is working fine.Is there any bug in DialogButton.OK

Thanks,
Kumar








Cody
Telerik team
 answered on 21 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?