-
-
-
-
-
System.NullReferenceException: Object reference not set to an instance of an object at click method.
- Env: Win7 x64, IE9 x32. WebAii 2012.2 920.
-
-
-
-
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();
<
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:
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();
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
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
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
{
}