Hi
I'm working on a project that requires me to check figures in various reports (Silverlight and SSRS).
I have a dashboard SSRS report that shows various subreports, for example Top 10 Users, which shows names and spend(£). I would like to access those 10 names and their respective figures and then run a SQL query to check they match.
I have set up the SQL connection and that is pulling the data out that I need, but I'm struggling to work out the best solution to capturing the data from the report.
Can you please help?
Many thanks
Andrew
I'm working on a project that requires me to check figures in various reports (Silverlight and SSRS).
I have a dashboard SSRS report that shows various subreports, for example Top 10 Users, which shows names and spend(£). I would like to access those 10 names and their respective figures and then run a SQL query to check they match.
I have set up the SQL connection and that is pulling the data out that I need, but I'm struggling to work out the best solution to capturing the data from the report.
Can you please help?
Many thanks
Andrew
4 Answers, 1 is accepted
0
Hello Andrew,
Where/how did you setup this SQL connection?
One approach I'm thinking you can take is to setup a data driven test. The test uses a SQL DB data source and uses that data to compare what's displayed in the browser. Would something like this work?
Regards,
Cody
Telerik
Where/how did you setup this SQL connection?
One approach I'm thinking you can take is to setup a data driven test. The test uses a SQL DB data source and uses that data to compare what's displayed in the browser. Would something like this work?
Regards,
Cody
Telerik
0
Andrew
Top achievements
Rank 1
answered on 29 Jan 2015, 09:04 AM
Hi Cody
Thanks for your reply.
I have set up the SQL connection as a coded step using: http://docs.telerik.com/teststudio/advanced-topics/coded-samples/general/access-sql-database Read from a SQL Database.
The report I am scripting for has seven subreports that display different data in one dashboard (SSRS).
My queries will return 5 or 10 pairs (i.e. name and amount). I'd like to be able to locate those values in the report (I have a test for each subreport), iterate over them and compare to the SQL query. (I'll post again to finish this off)
Thanks for your reply.
I have set up the SQL connection as a coded step using: http://docs.telerik.com/teststudio/advanced-topics/coded-samples/general/access-sql-database Read from a SQL Database.
The report I am scripting for has seven subreports that display different data in one dashboard (SSRS).
My queries will return 5 or 10 pairs (i.e. name and amount). I'd like to be able to locate those values in the report (I have a test for each subreport), iterate over them and compare to the SQL query. (I'll post again to finish this off)
0
Andrew
Top achievements
Rank 1
answered on 29 Jan 2015, 09:09 AM
I have been able to locate the html class for each subreport and the XPath, so I was thinking that I could use either
Find.AllByExpression() or Find.AllByXPath() loop over those and compare to the SQL.
I'm just not sure the best way to achieve this.
I'll have a look at your suggestion for a data driven test, but would that handle multiple results in one hit?
Thanks Andrew
Find.AllByExpression() or Find.AllByXPath() loop over those and compare to the SQL.
I'm just not sure the best way to achieve this.
I'll have a look at your suggestion for a data driven test, but would that handle multiple results in one hit?
Thanks Andrew
0
Hi Andrew,
With the data driven approach I suggested, you would want your SQL query to return just one row of data. Each cell in that row can be compared to one piece of data displayed in the UI.
It would not work very well if the SQL query returns multiple rows of data. Test Studio will want to compare each column of data to the same UI element displayed in the browser N times, where N = number of rows of data returned by the SQL query. Thus the test would run N times comparing each column to just one UI element during each iteration.
I'm not even sure if Find.AllByExpression() or Find.AllByXPath() would work very well. This approach would only work if the expression is unique enough to get only the correct set UI elements to compare against, and all of these UI elements are contained in the DOM at once. If you have to click something to move from report A to report B in order to bring the UI element into the DOM so you can fetch it, then Find.AllByXXXX won't work since it can only fetch what's currently in the DOM.
However if you actually can get all the UI elements to validate all at once with Find.AllByXXXX, then yes using code you could iterate through the UI elements returned and compare them to the data set returned by your SQL query done in code.
Regards,
Cody
Telerik
With the data driven approach I suggested, you would want your SQL query to return just one row of data. Each cell in that row can be compared to one piece of data displayed in the UI.
It would not work very well if the SQL query returns multiple rows of data. Test Studio will want to compare each column of data to the same UI element displayed in the browser N times, where N = number of rows of data returned by the SQL query. Thus the test would run N times comparing each column to just one UI element during each iteration.
I'm not even sure if Find.AllByExpression() or Find.AllByXPath() would work very well. This approach would only work if the expression is unique enough to get only the correct set UI elements to compare against, and all of these UI elements are contained in the DOM at once. If you have to click something to move from report A to report B in order to bring the UI element into the DOM so you can fetch it, then Find.AllByXXXX won't work since it can only fetch what's currently in the DOM.
However if you actually can get all the UI elements to validate all at once with Find.AllByXXXX, then yes using code you could iterate through the UI elements returned and compare them to the data set returned by your SQL query done in code.
Regards,
Cody
Telerik