Telerik Forums
Testing Framework Forum
1 answer
81 views

Hello.

I have a problem with frames.

My code:

var frame1 = ActiveBrowser.Frames["leftFrame"];
frame1.Find.ByXPath<HtmlSpan>("/html/body/form/span[2]/div/div/div/span").Click();
and Html:

<frameset cols="*,70%">
<frame scrolling="auto" src="/webstudio-test/faces/pages/modules/trace/tree.xhtml?first=true&uri=file%3A%2FC%3A%2Fopenl-tests%2Fuser-workspace%2Fa1%2FLLZIHOD%2Frules.xls%3Fsheet%3DRules%26range%3DB3%253AE13" name="leftFrame">
<html>
<head>
<body>
<form id="j_idt5" enctype="application/x-www-form-urlencoded" action="/webstudio-test/faces/pages/modules/trace/tree.xhtml" method="post" name="j_idt5">
<input type="hidden" value="j_idt5" name="j_idt5">
<span class="traceTreeParams">
<span id="j_idt5:traceTree">
<div id="j_idt5:j_idt8" class="rf-tr tree">
<div id="j_idt5:j_idt8:1:j_idt9" class="rf-tr-nd rf-tr-nd-colps rf-tr-nd-last">
<div id="j_idt9" class="rf-trn">
<span class="rf-trn-hnd-colps rf-trn-hnd"></span>
<span class="rf-trn-cnt">
</div>
<div id="j_idt5:j_idt8:1.1:j_idt12" class="rf-tr-nd rf-tr-nd-colps rf-tr-nd-last">
</div>
<input id="j_idt5:j_idt8__SELECTION_STATE" class="rf-tr-sel-inp" type="hidden" value="" name="j_idt5:j_idt8__SELECTION_STATE">
<script type="text/javascript">
</div>
</span>
<input id="javax.faces.ViewState" type="hidden" autocomplete="off" value="3034330929021769213:-4432157085689481536" name="javax.faces.ViewState">
</form>
</body>
</html>
</frame>
<frame scrolling="auto" src="/webstudio-test/faces/pages/modules/trace/showTraceTable.xhtml?first=true&uri=file%3A%2FC%3A%2Fopenl-tests%2Fuser-workspace%2Fa1%2FLLZIHOD%2Frules.xls%3Fsheet%3DRules%26range%3DB3%253AE13" name="mainFrame">
<noframes> <body> <p>To view content you need frames capable browser</p> </body> </noframes>
</frameset>

In FF works fine but in IE9 throw exception: 

          • System.NullReferenceException: Object reference not set to an instance of an object at click method.
          • Env: Win7 x64, IE9 x32. WebAii 2012.2 920.

Stoich
Telerik team
 answered on 09 Oct 2012
8 answers
231 views
Hi Guys

I'm using the Telerik Testing Framework (C#) and implementing the Telerik libraries, but there is a problem executing the Click method of an Anchor that is inside of a Span, this problem only presents with IE browser, instead of Click i need to do a MouseClick action.

This behavior only presents over one specific object of the application tested, in other anchor I don't have to deal with that problem, also noticed that with Firefox and Chrome the Click method works perfectly okay.

MouseClick works but is not the ideal way because we have a dependency of the mouse action and the focus/display on the application, I mean MouseClick don't work for Continuous Integration

 

 

if (myManager.ActiveBrowser.BrowserType != BrowserType.InternetExplorer)

 

{

 

 

    myManager.ActiveBrowser.Find.ByExpression<HtmlAnchor>("href=#", "innerText=" + GetLangInfo("Name")).Click();

 

}

 

 

else

 

 

 

    myManager.ActiveBrowser.Find.ByExpression<HtmlAnchor>("href=#", "innerText=" + GetLangInfo("Name")).MouseClick();

 



Any help would be really appreciated

Julio Cesar
Julio
Top achievements
Rank 1
 answered on 03 Oct 2012
1 answer
91 views
I'm doing some validation my my test to verify certain text exists on a page and it's always failing. Is there a property to see what text the "ContainsText" method is searching? (e.g. Manager.ActiveBrowser.Text)

Plamen
Telerik team
 answered on 01 Oct 2012
17 answers
365 views
Hi,

Is there a way to attach an existing IE (or any other browser) instance through the automation code ? I was using the Telerik.WebAii library and was unable to find any method to do this. Please do let me know if there is a way to do it ?

Regards,
Diwakar Gupta.
Plamen
Telerik team
 answered on 28 Sep 2012
4 answers
115 views

Hi Telerik Team,
I am facing problems with a zero sized textblock.

I used this, because Telerik Test Studio can't see the properties of my UserControl.
So I put a zero sized textblock directly under this UserControl.  (See Screenshot 1 & WPF-Code).

               
<StackPanel Grid.Column="1" Grid.RowSpan="2">

             <ToggleButton x:Name="PlayButton"

                              Margin="3,0,0,0"

                              Content="{StaticResource PlayShape}"

                              HorizontalAlignment="Center"

                              VerticalAlignment="Top"

                              Foreground="#FFFFFFFF"

                              Style="{StaticResource CJ_ToggleButtonStyle}"

                              RenderTransformOrigin="1.053,0.985"

                              Height="50"

                              Width="80"

                              ToolTipService.ToolTip="{Binding Path=LanguageResources.Play_Pause, Source={StaticResource Localizer}}"/>

                    <TextBlock x:Name="QAPlayerTimeCode" Width="0" Height="0" ></TextBlock>

                </StackPanel>

I try to add this Control over the DOM Control (because I can't see it). But when I do this, a second project is created (!). (See Screenshot 2).

And during runtime I get an exception, because appIndex  is "-1".

ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl plugin = Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl>("tagname=object", "type=~application/x-silverlight");
int appIndex = plugin.OwnerBrowser.GetSilverlightAppIndex(plugin);

How can I access this control?
If it is visible (hight and width over 1px) a can add and access it. But I need to use "hidden" Controls.

Greetings
Mostafa

Plamen
Telerik team
 answered on 28 Sep 2012
1 answer
42 views
Hi,

Can we access search attributes like Automation Id, Name from a already searched element at runtime?

For Example - 
If I have a control with automationID and Name attributes associated with it.
return Get<ArtOfTest.WebAii.Silverlight.UI.Button>("AutomationId=SearchButton","Name=SButton","XamlTag=button");

Is there any way so that during run time i can print the AutomationId, Name, XamlTag of the control?

Thanks,
Prachi
Plamen
Telerik team
 answered on 28 Sep 2012
3 answers
67 views
Is there a known issue for this method? I am finding that it only returns elements found in the VisualTree.Root. Meaning that if there are any Popups active/visible, they will not be included in the ElementsFromPoint return list. In this way it is not truly returning all available elements at the given point. Please advise.

Plamen
Telerik team
 answered on 21 Sep 2012
3 answers
115 views

   Hi,

    I am using Telerik Test Studio and writing about 20 tests for one of the e-commerce projects at work. I am learning as I go and   need some insight into how to do validation on source code within a page.

I am writing a test for a checkout process from initial product selection, basket, login, address etc right down to the confirmation page.

On the source of the confirmation page, I need to validate :

 1. Google Analytics tracking code for successful order
 2. Affiliate marketing tracking code
 3. Multivariate testing tool tracking code.

 Is there a way I can get Telerik to look at the source code of a page for the validation steps?

 Please respond urgently.

 Many thanks

Cody
Telerik team
 answered on 20 Sep 2012
2 answers
122 views
Hello Telerik Team,

I try to access an element from our application (not accessible outside the company sorry) with a XamlFindExpression and it doesn't work when some of the controls types are "proprietary". It always returns an error.

I use:
Dim SecondElement As TextBlock
SecondElement = SilverLightMain.appMain.Find.ByExpression(New XamlFindExpression("Name=FunctionScriptView","|","XamlPath=/Grid[0]/Border[1]/Grid[0]/Grid[0]/ScrollViewer[0]/Border[0]/Grid[0]/ScrollContentPresenter[0]/Border[0]/DEXWebv2.FunctionEditor.Views.Functions.DateLastDayOfMonthView[0]/Grid[0]/DEXWebv2.FunctionEditor.Views.Functions.FunctionParamControl[0]/ContentPresenter[0]/Grid[0]/Border[0]/TextBlock[0]")).[As](Of TextBlock)()

Is there a way to have the XamlFindExpression to work in this case?

Thank you.
test cdb
Top achievements
Rank 1
 answered on 19 Sep 2012
1 answer
129 views
Hi,

The default behavior of Test Studio and the Telerik Testing Framework is to time out after a certain interval if the element is not found. 

I would like to avoid the Timeout Exception and perform a different set of steps depending on whether the element is found. My application does not use silverlight.
I have checked the Telerik help document , Change Silverlight Find Strategy, but i think  it is applicable for only Silverlight applications.

Below is the code snippet which i want to perform if the 'MS2007AboveRadio' check box on the iframe is found. To avoid Timedout Exception if the element is not found, i have placed it in the try catch block. Tried the if else condition aswelll, but it gets timedout.

try
{
    Pages.application.FrameFrame1.MS2007AboveRadio.Check(true, true);
    Pages.application.FrameFrame1.CphMainBtnProceedImage.Click(true);
}
catch
{
}

Please suggest me better way to do it. Do we have something like Find Strategy for a c#.net application.

Regards,
Satyajeet
Plamen
Telerik team
 answered on 19 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?