Telerik Forums
Testing Framework Forum
9 answers
187 views
Hi all,

in our tests we must sometimes check if some text is bold.
For this purpose we use code like following:

Settings mySettings = new Settings(BrowserType.InternetExplorer, @"c:\log\");
mySettings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
Manager myManager = new Manager(mySettings);
myManager.Start();
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo("http://vkontakte.ru/login.php");
 
//That's the "Login" button.
Element link;
link = myManager.ActiveBrowser.Find.ByXPath("//td/*/*/*/*/a[1]");
HtmlControl lnk = new HtmlControl(link);
 
String weight = lnk.GetComputedStyleValue("fontWeight");
String style = lnk.GetComputedStyleValue("fontStyle");
String size = lnk.GetComputedStyleValue("fontSize");
 
 
Console.WriteLine(myManager.ActiveBrowser.BrowserType);
Console.WriteLine("Size: {0}", size);
Console.WriteLine("Weight: {0}", weight);
Console.WriteLine("Style: {0}", style);
myManager.Dispose();

Well, in Firefox everything looks fine and the output is like that:
FireFox
Size: 11px
Weight: 400
Style: normal

But in IE the output looks a bit strange:
InternetExplorer
Size: 11px
Weight:
Style: normal

So, we can get all the information about the font but its weight.
What is even better, that:
1) our tests MUST work in IE7
2) checking font-weight is a must-have point in lots of tests.

Thus we need any way to check whether the text is bold or not.

Looking forward for any useful ideas.

Thanks,
Yaroslav


Nikolai
Telerik team
 answered on 10 Sep 2010
7 answers
156 views
I am coming across a weird situation, just wondering if anybody else has seen it, or if I'm doing something terribly wrong.

My pointer is on the 'Next >>' button but the highlight and nub are far away. The nub is so far I can't click it without moving my pointer which then takes the highlight out of focus.
Cody
Telerik team
 answered on 08 Sep 2010
1 answer
124 views
I have tried to set global timeout when find element on the page but it doesn't work.

- This is working
HtmlElementContainer.Get<HtmlSpan>(new HtmlFindExpression("TextContent=Test", "tagname=span"), true, 20000);

- This is not working. It time out immediately. Is there something else I need to do?
HtmlElementContainer.Get<HtmlSpan>("TextContent=Test", "tagname=span");
app.config:
<WebAii.Settings
...
...
...
    waitCheckInterval="20000"
  />

Thanks,
Chhuong
Konstantin Petkov
Telerik team
 answered on 08 Sep 2010
2 answers
100 views
I am using a AutoCompleteBox in my Silverlight app but I can't work out how to get the number of options listed by the AutoCompleteBox because I can't cast the control to AutoCompleteBox because it can't be converted to a WebAii FrameworkElement.

Any ideas?  My code looks something like this.  

var autoCompleteBox = app.FindName(testUtil.AutoCompleteBox);
autoCompleteBox.User.TypeText("f", 50);
 
autoCompleteBox.Refresh();
 
var list = (List<String>) autoCompleteBox.As<AutoCompleteBox>().ItemsSource;
 
Assert.That(list.Count, Is.EqualTo(2));
Lim
Top achievements
Rank 1
 answered on 08 Sep 2010
0 answers
166 views
hi All,

I am using WeAii 2.0 framework. I have a scenario where windows logon dialog box appears twice for authentication on accessing test website. First time dialog box is handled  but it reappears again and script fails to handle it again.
Below is the lines of code included in script

Manager.DialogMonitor.AddDialog(

LogonDialog.CreateLogonDialog(ActiveBrowser, <USerNMame>, <passwod>, DialogButton.OK));

 

Manager.DialogMonitor.Start();

 

ActiveBrowser.NavigateTo(

"URL");

Any idea how to resolve this issue.
Suggestion appreciated :)

Thanks in advance 
Regards,
Mahendra

 

Mahendra Kumar
Top achievements
Rank 1
 asked on 08 Sep 2010
8 answers
563 views
I have two drop down boxes: dd1and dd2.  dd2 starts of being disable and has no value.  dd2 is populated dynamically based on values selected in dd1.  dd2 will be enabled once the values are populated.  However when I try to open dd2 after I select a value from dd1 it requires 2 clicks (or a double click) using WebAii.  If I do this manually I only require 1 click.  

So why do I need to double click dd2?

Some things that I've tried:
1/ added a Thread.sleep(1000) before clicking on dd2.  This didn't work.
2/ added MouseHover before I did the click on dd2.  That didn't work either.
3/ used a while loop to check that dd2 was enabled otherwise sleep(1000).  That didn't work.  

var keyComboBox = app.FindName<ComboBox>("dd1");
keyComboBox.User.Click();
keyComboBox.Refresh();
keyComboBox.SelectByText("Sport");
 
var valueComboBox = app.FindName<ComboBox>("dd2");     
valueComboBox.User.Click(MouseClickType.LeftDoubleClick);
valueComboBox.Refresh();
valueComboBox.SelectByText("Football");



Konstantin Petkov
Telerik team
 answered on 08 Sep 2010
3 answers
148 views
When I use HtmlElementContainer.Get<HtmlDiv>(...), it will throw exception if it can't find element in the page for a specified period. Is there any setting to return null if the control is not found? I don't want to catch exception every time I find an element.

Example: this is what I want to do

HtmlDiv divUserName = HtmlElementContainer.Get<HtmlDiv>(new HtmlFindExpression(...), true, 5000);
Assert.IsNotNull(divUserName , "Cannot find username control");

Nikolai
Telerik team
 answered on 03 Sep 2010
1 answer
166 views
Hi, 
I've got the following radio button among other similar radio buttons on the same page: 
<input type="radio" value="green" name="outcome_LO"/>
I came with this query but it's quite expensive and takes a while to execute (That page has 18 radios)..Any suggestion for a more elegant solution ? 
HtmlInputRadioButton rr = (from b in Find.AllControls<HtmlInputRadioButton>() where b.Value.Equals("green") && b.Name.Equals("outcome_LO") select b).First();

rr.Check(
true, true);
Wit
Top achievements
Rank 1
 answered on 02 Sep 2010
1 answer
118 views

Hello Team,

Have you any plan to realize some wrappers for Silverlight components available on the market?

In particular for http://www.componentone.com/SuperProducts/StudioSilverlight/.

I had a look to the custom control thread, but as I am not so familiar with this type of code.

I would like at least be able to manipulate the C1DataGrid using VB.net.

Kind regards.

Konstantin Petkov
Telerik team
 answered on 27 Aug 2010
1 answer
210 views
I can't find anywhere examples for Wait.ForCondition.
I would like my test to wait for input box to contain text longer than 4 characters.
How to do it?
Wit
Top achievements
Rank 1
 answered on 26 Aug 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?