Telerik Forums
Testing Framework Forum
7 answers
171 views

I’m trying to do a few things in the Grid that Telerik Automation can’t do in Code.  We have a products list that contains a button with the product name and the expiration date in the HTML Grid.

Part one is to gather the button’s names with the Expiration Date.  Then we will do the account updates then run another test that will validate no changes are done.  I need this to be data driven. The issue is that I encounter errors. 

 

Exception thrown executing coded step: '[Row_Index] : @"Indxing through Active'.

InnerException:

System.NullReferenceException: Object reference not set to an instance of an object.

   at PortalC_Sharp.ExpDate_Extract.Row_Index() in C:\MyProjects\PortalC_Sharp\ExpDates\ExpDate Extract.tstest.cs:line 119

------------------------------------------------------------

'8/8/2012 9:23:57 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.

 

Can you look at my code to see what I’m doing wrong?

Thanks,

John



<TBODY>
<TR>
<TD style="WIDTH: 100%">
<TABLE width="100%" align=left>
<TBODY>
<TR vAlign=top>
<TD style="WIDTH: 100%; COLOR: navy; FONT-WEIGHT: bold" align=left><A style="WIDTH: 135px; DISPLAY: inline-block" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_rbProduct class="RadButton RadButton_Windows7 rbSkinnedButton" href="javascript:void(0)"><INPUT style="PADDING-LEFT: 4px; WIDTH: 100%; PADDING-RIGHT: 0px" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_rbProduct_input class=rbDecorated tabIndex=-1 value=E-dition type=submit name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl02$rbProduct_input><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_rbProduct_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_rbProduct_ClientState autocomplete="off"></A> </TD>
<TD style="WIDTH: 100%" noWrap align=right><IMG id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_imgAttention src="Images/error.png"
<DIV style="POSITION: absolute; DISPLAY: none" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_rtAttention><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_rtAttention_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_rtAttention_ClientState autocomplete="off"> </DIV></TD>
<TD noWrap align=right><SPAN style="COLOR: darkgreen" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_lblExpiration>Expiration: Jan 01, 2013</SPAN> </TD></TR>
<TR vAlign=top>
<TD colSpan=3 align=left><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl02_lblMessage value="Now current standards are just a few clicks away with E-dition, delivering 24/7 web-based access to all content in the printed <i>Joint Commission Comprehensive Accreditation Manual</i>. Quick-click navigation and automatic updates provide you with the essential standards information you and your staff need. Full-text searching delivers rapid access to topics and you can use filtering and service profilesto tailor views to your needs. Plus, quickly understand how Joint Commission elements of performance relate to CMS requirements through our interactive crosswalk. " type=hidden name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl02$lblMessage> <SPAN id=message>Now current standards are just a few clicks away with E-dition, delivering 24/7 web-based access to all </SPAN> <IMG style="FLOAT: right; CLEAR: right" id=imgToggleMessage src="http://sandweb2k8.jcaho.net:42111/Images/Icons/iconShowMore.gif" jQuery1703061065552459071="1"></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD style="WIDTH: 100%">
<TABLE width="100%" align=left>
<TBODY>
<TR vAlign=top>
<TD style="WIDTH: 100%; COLOR: navy; FONT-WEIGHT: bold" align=left><A style="WIDTH: 135px; DISPLAY: inline-block" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_rbProduct class="RadButton RadButton_Windows7 rbSkinnedButton" href="javascript:void(0)"><INPUT style="PADDING-LEFT: 4px; WIDTH: 100%; PADDING-RIGHT: 0px" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_rbProduct_input class=rbDecorated tabIndex=-1 value=AMP type=submit name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl03$rbProduct_input><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_rbProduct_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_rbProduct_ClientState autocomplete="off"></A> </TD>
<TD style="WIDTH: 100%" noWrap align=right><IMG id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_imgAttention src="Images/4CR.png"
<DIV style="POSITION: absolute; DISPLAY: none" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_rtAttention><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_rtAttention_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_rtAttention_ClientState autocomplete="off"> </DIV></TD>
<TD noWrap align=right><SPAN style="COLOR: darkgreen" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_lblExpiration>Expiration: Jan 01, 2013</SPAN> </TD></TR>
<TR vAlign=top>
<TD colSpan=3 align=left><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl03_lblMessage value="Accreditation Manager Plus (AMP®) is the software solution for managing your continuous compliance preparation process. AMP simplifies self-assessment across your organization and provides a central location for all accreditation activities.  When it comes time to completing your organization's PPR, simply export your AMP scoring data directly to The Joint Commission site." type=hidden name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl03$lblMessage> <SPAN id=message>Accreditation Manager Plus (AMP®) is the software solution for managing your continuous compliance prepa</SPAN> <IMG style="FLOAT: right; CLEAR: right" id=imgToggleMessage src="http://sandweb2k8.jcaho.net:42111/Images/Icons/iconShowMore.gif" jQuery1703061065552459071="2"></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD style="WIDTH: 100%">
<TABLE width="100%" align=left>
<TBODY>
<TR vAlign=top>
<TD style="WIDTH: 100%; COLOR: navy; FONT-WEIGHT: bold" align=left><A style="WIDTH: 135px; DISPLAY: inline-block" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_rbProduct class="RadButton RadButton_Windows7 rbSkinnedButton rbDisabled" disabled href="javascript:void(0)"><INPUT style="PADDING-LEFT: 4px; WIDTH: 100%; PADDING-RIGHT: 0px" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_rbProduct_input class=rbDecorated disabled tabIndex=-1 value=ECM type=submit name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl04$rbProduct_input><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_rbProduct_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_rbProduct_ClientState autocomplete="off"></A> </TD>
<TD style="WIDTH: 100%" noWrap align=right><IMG id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_imgAttention src="Images/error.png"
<DIV style="POSITION: absolute; DISPLAY: none" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_rtAttention><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_rtAttention_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_rtAttention_ClientState autocomplete="off"> </DIV></TD>
<TD noWrap align=right><SPAN style="COLOR: maroon" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_lblExpiration>Expiration: Mar 02, 2012</SPAN> </TD></TR>
<TR vAlign=top>
<TD colSpan=3 align=left><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl04_lblMessage value="E-dition Compliance Monitor (ECM™) is an online library of health care industry regulations, organized and linked by Joint Commission Hospital Standards, designed to help you navigate the laws, regulations, and daily actions made by various government and regulatory agencies.<br/><br/>By having a central repository for standards and regulatory information, ECM gives you the tools you need to help reduce risk, avoid costly compliance deficiencies, and ultimately improve patient safety.<br/><br/>Updated daily, ECM features the easy-to-use E-dition® interface and navigation, and provides expanded search and filter features for quick retrieval of information.  This software also features a “What’s New” e-mail alert tailored to your specific areas of interest." type=hidden name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl04$lblMessage> <SPAN id=message>E-dition Compliance Monitor (ECM™) is an online library of health care industry regulations, organized a</SPAN> <IMG style="FLOAT: right; CLEAR: right" id=imgToggleMessage src="http://sandweb2k8.jcaho.net:42111/Images/Icons/iconShowMore.gif" jQuery1703061065552459071="3"></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD style="WIDTH: 100%">
<TABLE width="100%" align=left>
<TBODY>
<TR vAlign=top>
<TD style="WIDTH: 100%; COLOR: navy; FONT-WEIGHT: bold" align=left><A style="WIDTH: 135px; DISPLAY: inline-block" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_rbProduct class="RadButton RadButton_Windows7 rbSkinnedButton" href="javascript:void(0)"><INPUT style="PADDING-LEFT: 4px; WIDTH: 100%; PADDING-RIGHT: 0px" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_rbProduct_input class=rbDecorated tabIndex=-1 value=Tracers type=submit name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl05$rbProduct_input><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_rbProduct_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_rbProduct_ClientState autocomplete="off"></A> </TD>
<TD style="WIDTH: 100%" noWrap align=right><IMG id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_imgAttention src="Images/4CR.png"
<DIV style="POSITION: absolute; DISPLAY: none" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_rtAttention><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_rtAttention_ClientState type=hidden name=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_rtAttention_ClientState autocomplete="off"> </DIV></TD>
<TD noWrap align=right><SPAN style="COLOR: darkgreen" id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_lblExpiration>Expiration: Jan 01, 2013</SPAN> </TD></TR>
<TR vAlign=top>
<TD colSpan=3 align=left><INPUT id=ctl00_cphApp_rdProducts_C_grdMyProducts_ctl05_lblMessage value="An online tool that allows users to record, track and trend internal Tracer activities by creating a custom tracer from existing Joint Commission Resources templates of questions  or from questions customized or created by your organization." type=hidden name=ctl00$cphApp$rdProducts$C$grdMyProducts$ctl05$lblMessage> <SPAN id=message>An online tool that allows users to record, track and trend internal Tracer activities by creating a cus</SPAN> <IMG style="FLOAT: right; CLEAR: right" id=imgToggleMessage src="http://sandweb2k8.jcaho.net:42111/Images/Icons/iconShowMore.gif" jQuery1703061065552459071="4"></TD></TR></TBODY></TABLE></TD></TR></TBODY>


Here is my code:

[

 

CodedStep(@"Indxing through Active")]

 

 

 

public void Row_Index()

 

{

 

 

    HtmlTable ContenthtmlTable = Pages.JointCommissionResources6.MyActive.Find.ById<HtmlTable>("ctl00_cphApp_rdProducts_C");

 

 

 

 

    HtmlDiv gridDiv = Find.ById<HtmlDiv>("ctl00_cphApp_rdProducts_C");

 

 

 

    HtmlDiv content = gridDiv.Find.ByAttributes<HtmlDiv>("id=ctl00_cphApp_rdProducts_C_grdMyProducts");

 

 

 

 

    HtmlTable table = content.Find.ByTagIndex<HtmlTable>("table", 0);

 

    Log.WriteLine(

 

"***********************************************");

 

    Log.WriteLine(

 

"Rows Count: " + table.Rows.Count.ToString());

 

    Log.WriteLine(

 

"***********************************************");

 

 

 

 

 

    foreach (HtmlTableRow row in table.AllRows)

 

    {

 

 

       foreach (HtmlTableCell cell in row.Cells)

 

       {

           Log.WriteLine(cell.InnerText);

       }

     }

 

}



Plamen
Telerik team
 answered on 20 Aug 2012
11 answers
153 views
I'm trying to automate a click on a RadGridView row to get it to enter edit mode. My UI is brain-dead simple, as I'm just evaluating the test Framework for use in our real application. It's just a RadViewGrid in a Window. I'm using MS Test to run the UI tests. I'm just binding the RadGridView to a collection of dummy objects. The test looks like this:

public void CanObserveCellContent()
{
    var grid = wpfApp.MainWindow.Find.ByName<RadGridView>("_searchResults");
    grid.Rows[0].User.Click(MouseClickType.LeftDoubleClick);
    //other steps and assertions
}

The second line simulating the click throws the exception. But if I change the second line to this and comment out the rest of the test:

Assert.AreEqual("Test1", grid.Rows[0].Cells[0].Text);

the test passes. What is it about clicking automation that makes it unable to find the row?
Cody
Telerik team
 answered on 17 Aug 2012
1 answer
158 views
Hi, 

We're currently trying to speed up our tests by not launching a new browser with each test we run. Instead, we're keeping the active browser open and deleting the cache and cookies to restore the browser to its initial state (e.g. making sure the user is no longer logged in).  

So far we've tried calling Cookies.DeleteCookies() as well as ClearCache(BrowserCacheType.Cookies), but neither seem to be deleting the session cookies in IE8.  The current behavior I'm seeing is that after calling these methods and re-navigating to our site, the user still remains logged in.  

Does anyone know the solution to this? Thanks.
Byron
Telerik team
 answered on 17 Aug 2012
11 answers
205 views
HI,

I am trying to run the silverlight user interface tests on the build server and got the following exceptions.

------------------------------------------------------------
'3/08/2012 4:54:07 PM' - Using .Net Runtime version: '4.0.30319.269' for tests execution.
'3/08/2012 4:54:07 PM' - Starting execution....
'3/08/2012 4:54:07 PM' - Detected a Silverlight Test. Setting EnableSilverlight=True
'3/08/2012 4:54:07 PM' - Failure detected during execution. Details:
------------------------------------------------------------
'3/08/2012 4:54:07 PM' - System.NullReferenceException: Object reference not set to an instance of an object.
   at ArtOfTest.WebAii.Core.Manager.SetupDialogMonitoring()
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InitializeWeb(ExecutionEngineCreateParams initParams)
   at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.CreateAndInitializeEngine(Test test, ExecutionEngineCreateParams cp)
   at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(ExecuteTestCommand command)
------------------------------------------------------------
'3/08/2012 4:54:07 PM' - Test completed!

Are there any documentation for setting up this testing framework with teamcity v7 ? I read somewhere i need to start the buildagent manually from command prompt. This is not feasible as it needs to be done on every restart!!
Byron
Telerik team
 answered on 16 Aug 2012
1 answer
126 views
Hi,

I have this little issue, that I don't know how to change rows in my data driven test..

There is my example:

1. Navigate to SL application
2. Loop 2 times
2.1 Fill username textbox - DataDriven: [$(username)]
2.2 FIll password textbox - DataDriven: [$(password)] 

3. Click OK button

Excel file contains 2 columns called username and password. The excel sheet look like this:
username password
automat         automat
robot robot

And my problem is, when I run my test, the loop section fill textboxes only with automat - automat 2 times.. Shouldn't it to skip to second row and fill it with robot - robot on second iteration?

My code look like this:
http://dl.dropbox.com/u/96981414/dd.jpg

thanks for advice!
Byron
Telerik team
 answered on 13 Aug 2012
1 answer
140 views

Sometime Expressions doesn't work.

For example:

public static readonly HtmlFindExpression ProjectLabelInProjectsTree = new HtmlFindExpression("id=projectTree", "|", "class=rf-tr-nd-colps", "|", "class=rf-trn-cnt");
Find.ByExpression<HtmlSpan>(MainTestPageObjects.ProjectLabelInProjectsTree).Click();

<div id="projectTree" class="rf-tr">
<div id="projectTree:1st - Projects:j_idt43" class="rf-tr-nd rf-tr-nd-colps firefinder-match">
<div id="j_idt43" class="rf-trn firefinder-match">
<span class="rf-trn-hnd-colps rf-trn-hnd"></span>
<span class="rf-trn-cnt rf-trn-sel">
</div>
</div>
<div id="projectTree:2nd - Deploy Configurations:j_idt52" class="rf-tr-nd rf-tr-nd-lf rf-tr-nd-last">
<div id="j_idt52" class="rf-trn firefinder-match">
<span class="rf-trn-hnd-lf rf-trn-hnd"></span>
<span class="rf-trn-cnt">
</div>
</div>

code return exception - 

          • System.NullReferenceException: Object reference not set to an instance of an object.
Anton
Top achievements
Rank 1
 answered on 09 Aug 2012
3 answers
157 views

Hello to everyone!. 
How to click Yes button in this popup? Where can I find this popup? Manager.Browsers.Count returns 1. Also I tried with no luck to search it in ActiveBrowser.Window.AllChildren collection. 
Cody
Telerik team
 answered on 08 Aug 2012
1 answer
108 views
Hi, I want to add a new row to a RadGridView via automation. I've searched the forums but haven't found this topic yet.
I see that there is a NewRow property, in my case..
Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings.NewRow

There is also a function called AddNewRow which I assume is used to make the new row.
So I'm guessing I have to set each column in my NewRow then call AddNewRow to commit it. But I don't know how to loop through each column in my row to set each columns value.
So far I have...

Telerik.WebAii.Controls.Xaml.RadGridView rgv = Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings;
int rowCounter = rgv.Rows.Count;
int cellCounter = 1; 
 
foreach(Telerik.WebAii.Controls.Xaml.GridViewCell gCell in Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings.NewRow) { //Nested loop; Goes through all the cells within each row
           
     if (gCell.XamlTag == "textbox" && gCell.AutomationId == "PART_EditableTextBox")
        gCell.Text = (string)(System.Convert.ChangeType(Data["Hours"], typeof(string)));
        //You can implement any type of verification you like against the text here
 
     if (gCell.XamlTag == "selectivescrollinggrid" && gCell.Name == "grid")
        gCell.Text = (string)(System.Convert.ChangeType(Data["Hours"], typeof(string)));
        //You can implement any type of verification you like against the text here
 
        cellCounter++;
    }
    rowCounter++;

     Pages.USSPOSCOIndustries.FrameHome.SilverlightApp.GridviewEarnings.AddNewRow();

Is this correct? Also, I would like to search by xamlpath as well as xamlTag for a column's textbox, dropdown, etc. Is this possible?

Thanks for the help
Cody
Telerik team
 answered on 07 Aug 2012
3 answers
106 views
Hi,

I am using the Webaii dll along side VSTS to develop some test scripts for automation of CRM 2011, in one of the test case we have a simple silver light control embedded in the Account form, I wanted to have a click action on the button.
However i am unable to acess the button, as a matter of fact the Developer tool provided on IE can catch the frame but not the id of the button inside (only for SL).
Can any one suggest an article or approach to access the controls inside the embedded SL on a CRM from.
I have added the SL as a web resource (xap) on the form.

Any help appriciated...

Thanks,
Saket
Hameed
Top achievements
Rank 1
 answered on 30 Jul 2012
1 answer
230 views
Hi everyone,

I'm having an issue when I try to run a test in Google Chrome. Basically, the issue is with the browser connection, it just the following error:

Network Error (dns_unsolved_hostname)
Your requested host "localhost.mydomain.com" could not be resolved by DNS

I'm running the test in Windows 7 64 bits, I know that you don;t have support for 64 bits version, but just want to be sure it's not a problem related with this. Could someone know what could be the problem?

I've attached an screenshot so you can see what I see.
Thanks in advance,
Juan
Nikolai
Telerik team
 answered on 30 Jul 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?