We have a weird request from one of our client to provide them with load test statistics for the Composite C1 Console. I attempted doing this by using JMeter.
The Problem: Everything on the C1 UI is dynamic content. How can one write a generic test suite which targets specific fields on the page. I know Composite C1 is pretty new but any rough guide and ideas would be appreciated.
Did you tried C1 Log Viewer? You can add primitive "marks" like:
Log.LogInformation("my test","test point 1");
To check speed of console you can inspect logs with "Verbose" title "ConsoleFacade".. start here:
2014 09 01 16:49:37.92 50 342 Verbose ConsoleFacade Console unregistred by 'admin' id = 'key20218859356246321'
finish:
2014 09 01 16:49:51.02 50 350 Verbose ConsoleFacade New console registred by 'admin' id = 'key12416624995518122'
Related
Scenario:
There are 5 Links in the Home page:
Link 1
Link 2
Link 3
Link 4
Link 5
Each of the above links are separate test cases, so there are a total of 5 test cases.
All the links may not present in all the sites, according to the requirements.
So I need to write a Robot framework test case which works dynamically for all the sites, Like 1 site may have 3 links only some has all the 5 links. So its like SKIPPING a particular Test case if that lisk is not present.
*** Keywords ***
Go to Manage Client Reports
Click Link link:Manage Client Reports
Can anyone help.
In the upcoming Robot Framework Release 4.0 a new test status skipped will be introduced. Here is a brief status about the release:
Past due by 27 days 87% complete
Major release concentrating on adding the skip status (#3622), IF/ELSE
(#3074) and enhancing the listener API (#3296 and #3538). Last major
release to support Python 2.
So it can be ready any time soon now.
This is what you can have New SKIP status #3622. There will be a Skip If and a Skip keywords and more to be used.
How to skip tests
There are going to be multiple ways:
A special exception that library keywords can use to mark a single test to be skipped. See also #3685.
BuiltIn keyword Skip (or Skip Test and Skip Task) that utilizes the aforementioned exception.
BuiltIn keyowrd Skip If to skip based on condition.
When the skipping exception is used in a suite setup, all tests in the suite are skipped.
Command line option --skip to unconditionally skip tests based on tags. Similar to --exclude but skipped tests are shown in logs/reports
with a skip status and not dropped from execution altogether.
Command line option --skiponfailure to skip tests if they fail. Similar effect than with the current --noncritical.
What about criticality
As already discussed in #2087, the skip status is very similar feature
than Robot's current criticality concept. There are many people who
would like to have both, but I don't think that's a good idea and
believe it's better to remove criticality when skipping is added.
Separate issue #3624 covers removing criticality and explains this in
more detail. Colors
Skip status needs a specific color to match current pass (green) and
fail (red). Yellow feels like a good candidate with a traffic light
metaphor, but I'm open for other ideas and we could possibly change
other colors as well. Probably should make colors configurable too --
currently only report background colors support it.
Report background color mentioned above needs some thinking as well.
Currently it's either green or red, but with the added skip status we
could use also yellow or whatever skip color we decide to use.
Different scenarios where different colors could be used are listed
below (assuming green/yellow/red scheme):
All tests pass. This is naturally green.
Any test fails. This is naturally red.
Any test is skipped (no failures). This probably should be green but could also be yellow.
All tests skipped. This could be yellow. Could also be green but that's a bit odd if all tests are yellow.
Depending on your deadlines you might won't be able to wait this release, nevertheless it is a good to know thing.
There is an advanced solution where you can generate your test cases run-time. To do so you have to implement a small library that also acts as a listener. This way it can have a start_suite method that will be invoked and it will get the suite(s) as Python object(s), robot.running.model.TestSuite. Then you could use this object along with Robot Framework's API to create new test cases. The idea below was inspired by and it is based on this blog post: Dynamically create test cases with Robot Framework.
DynamicTestLibrary.py:
from robot.running.model import TestSuite
class DynamicTestLibrary(object):
ROBOT_LISTENER_API_VERSION = 3
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
ROBOT_LIBRARY_VERSION = 0.1
def __init__(self):
self.ROBOT_LIBRARY_LISTENER = self
self.top_suite = None
def _start_suite(self, suite, result):
self.top_suite = suite
self.top_suite.tests.clear() # remove placeholder test
def add_test_case(self, keyword, *args):
tc = self.top_suite.tests.create(name=keyword)
tc.keywords.create(name=keyword, args=args)
globals()[__name__] = DynamicTestLibrary
UPDATE for Robot Framework 4.0
Due to the backward incompatible changes (Running and result models have been changed) made in the 4.0 release the add_test_case function should be change as below if you are using version above 4.0.
def add_test_case(self, name, keyword, *args):
tc = self.top_suite.tests.create(name=name)
tc.body.create_keyword(name=keyword, args=args)
You can utilize this library in a suite setup, in which you check which links are present and add test cases for the ones that are available.
test.robot
*** Settings ***
Library DynamicTestLibrary
Suite Setup Check Links And Generate Test Cases
*** Variables ***
##{LINKS} Manage Clients # test input 1
#{LINKS} Manage Clients Manage Client Hardware # test input 2
##{LINKS} Manage Clients Manage Client Hardware Manage Client Reports # test input 3
*** Test Cases ***
Placeholder
[Documentation] Placeholder test that will be removed during execution.
No Operation
*** Keywords ***
Check Links And Generate Test Cases
FOR ${link} IN #{LINKS}
DynamicTestLibrary.Add Test Case Go to ${link}
END
Go to Manage Client Reports
Log Many Click Link link:Manage Client Reports
Go to Manage Client Hardware
Log Many Click Link link:Manage Client Hardware
Go to Manage Clients
Log Many Click Link link:Manage Clients
Go to ${link} will give the appropriate keyword name that will be called in a test case with the same name. You can check with each example input list that the number of executed tests will be equal with the length of the list.
Here is the output:
# robot --pythonpath . test.robot
==============================================================================
Test
==============================================================================
Go to Manage Clients | PASS |
------------------------------------------------------------------------------
Go to Manage Client Hardware | PASS |
------------------------------------------------------------------------------
Test | PASS |
2 critical tests, 2 passed, 0 failed
2 tests total, 2 passed, 0 failed
==============================================================================
I have two table definitions in DDS, compiled into *FILE objects and filled with data:
Kunpf:
A UNIQUE
A R KUNTBL
A FIRMA 60A ALWNULL
A KUNR 5S 0B
A KUNID 4S 0B
A K KUNR
A K KUNID
Kunsupf:
A R KUNSUTBL
A KUNID R B REFFLD(KUNID KUN/KUNPF)
A
A SUCHSTR 78A
A K SUCHSTR
A K KUNID
I'm using the following statement in interactive SQL (STRSQL):
SELECT DISTINCT FIRMA, KUNR FROM KUN/KUNPF
LEFT JOIN KUN/KUNSUPF ON (KUNPF.KUNID = KUNSUPF.KUNID)
WHERE SUCHSTR LIKE 'Freiburg%'
ORDER BY FIRMA
FOR READ ONLY
Everytime I execute this statement, I'm getting a considerable delay until the answer screen opens up. Beforehand a message is shown, stating that a temporary access path is being created.
How can I find out which/how this temporary access path is created? My goal is to have this access path made permanent so it doesn't need to be rebuilt with every invocation of this query.
I searched the net (especially the IBM site) but what I found out was mostly for DB2 on z/OS. The F4-Prompting facility in STRSQL doesn't provide help: I was searching for something like EXPLAIN SELECT from MySQL. The IBM DB2 Advanced Functions and Administration PDF states that there's a debug mode but it seems that it is only available from some (old) Windows tool I don't remember to have.
I'm utilizing V4R5, if this is relevant.
to see the access path on the green screen...
strdbg
strsql
run your statement
exit f3
enddbg
dspjoblog
the access path messages are at the bottom of the log f10 f18 afaik
v4r5??? That's like 20 years old...
For the IBM i, the "Run SQL Scripts" component of the old Client Access For Windows iSeries Navigator component and the new Access Client Solutions (ACS) contains Visual Explain (VE).
Luckily it seems though it was added to v4r5
http://ibmsystemsmag.com/ibmi/administrator/db2/database-performance-tuning-with-visual-explain/
Just start iNav, right click on "Database" and select "Run SQL Scripts"
Paste your query there and click "Visual Explain" -->"Run and Explain"
(or the corresponding button)
Optionally, in green screen.
Do a STRDBG to enter debug mode, F12 to continue and then go into STRSQL. The Db optimizer will then output additional messages into the joblog giving you more information about what it is doing..
I read here that EVM cards will sign some transaction data.
I would like to do this with my card, using my phone, and verify that the signature on the result is correct.
To start, I issued this command ("request APDU"):
00:A4:04:00:0E:32:50:41:59:2E:53:59:53:2E:44:44:46:30:31:00
One of the "Application IDs" was this:
A00000038410
So then I issued this command ("Select Payment application"):
00:A4:04:00:07:A0:00:00:00:03:10:10:00
and it returned this "Processing Options Data Object List (PDOL)":
9F66049F02069F37045F2A02
I read here how to decode this, because I couldn't find the official spec anywhere:
9F6604 - the tag 9f 66 represents the terminal transaction qualifiers
9F0206 - tag 9f 02 stands for authorized amount. The PDOL list must have the amount, authorized, coded into 6h bytes added to it.
9F3704 - tag 9f 37 stands for unpredictable number, thus encode such a number in 4 bytes and add it to the list
and here how to decode this:
5F2A02 - TX currency code
I understand the next step is to run "Get Processing Options" but this is where I got stuck. I tried:
80:A8:00:00:02:83:00:00
80:A8:00:00:12:83:10:01:02:03:04:05:06:07:08:01:02:03:04:05:06:07:08:00
80:A8:00:00:12:83:10:F3:20:40:00:00:00:00:01:00:00:04:04:06:03:05:08:00
80:A8:00:00:02:83:10:F3:20:40:00:00:00:00:01:00:00:04:04:06:03:05:08:00
All gave back a result of 6D:00 (Instruction code not programmed or invalid).
I tried looking in "emv book 3" and "emv book 4" but neither seem to contain the relevant information.
What do I need to do next in order to make a transaction, sign, and check the result?
Your GPO commands needs to provide the PDOL values requested by the card. The requested tags are:
9F66 - 4 bytes
9F02 - 6 bytes
9F37 - 4 bytes
5F2A - 2 bytes
So the commands needs to provide these in the same order, with expected lengths.
Assuming you want to send the following sample values:
9F66: 11223344
9F02: 112233445566
9F37: 11223344
5F2A: 1122
Your GPO command will look like this:
80A800001283101122334411223344556611223344112200
Where the PDOL data is 11223344112233445566112233441122.
Hope this helps
If PDOL found in response of select application, here you need to pass the value of PDOL tags in GPO command,
can find a very good article Here. hope it helps.
I have a Web performance Script in Visual Studio. I have turned this into Coded Webtest in VB by clicking on the Generate Code button.
In my web test there are a 5 functions. Apart from the 1st the others are for SQL Procedures.
Among a few things, I need a web request that does a certain action. Based on that action, In the response body - it generates a Unique Id.
I need this Id to make it accessible across all the functions.
The Response body is something like this :
0x00000000 7B 22 69 64 22 3A 36 35 33 30 36 36 33 7D {"id":2133221}
Now I wanted to know, how do I do it. I just need 2133221.
I tried
using the Context Parameter name and appending it to a .to string...it did not work. I tried doing by looking over the net and trying out a few options. I'm lost now. Can anyone help.
The simplest solution is the below one.
str = "0x00000000 7B 22 69 64 22 3A 36 35 33 30 36 36 33 7D {""id"":2133221}"
arr = Split(str, ":")
strID = Left(arr(1), len(arr(1)) - 1)
msgbox strId
However, If you still need a more robust one, try regex
See access the response from a web coded performance test for how to access the response ina coded test. While it is in C# the VB style is similar.
For your case the displayed string shows a hex dump of the actual body. Th ebody does not include the 0x00000000 7B 22 69 64 22 3A 36 35 33 30 36 36 33 7D part.
A simple approach to getting the wanted Id string is to use a Extract text extraction rule with a Start with of "id": and an Ends with of ". This will need to be done on the ".webtest" file.
I strongly recommend against converting web tests to coded tests. It loses all the high level structure of the ".webtest" format. The Web Test Editor has many facilities for easily enhancing and changing tests, all of them are lost when changing to a coded test. A little learning about extraction and validation rules gives you many facilities. If you are happy working with the VB of a coded test then you should also be happy to write plugins so look at web test request plugins and web test plugins.
I'm trying to follow this tutorial, but VS debugger keep asking me for a file named
FluentConfiguration.cs when it gets to this line:
return Fluently.Configure()
.Database(MySQLConfiguration.Standard
.ConnectionString(c => c
.Server("localhost")
.Database("test")
.Username("root")
.Password("w1e2a3r4")))
.Mappings(m => m
.AutoMappings.Add(model))
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
All my code is completely identical to the tutorial's except for this line (I'm using MySql). I triple checked the parameters and it should be ok..
What I get is a dialog box asking me to locate FluentConfiguration.cs, and when it fails to find it it gives:
An invalid or incomplete configuration was used while creating a SessionFactory.
Check PotentialReasons collection, and InnerException for more detail.
I tried copying this file from here, but this didn't work as well.
What am I missing out on here?
Technical info- I'm using VS 2010 express, ASP.NET MVC3, MySQL server 5.5 and connector: 6.3.6
Edit:
This is the inner exception's message:
Could not create the driver from NHibernate.Driver.MySqlDataDriver, NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.
Edit 2:
Now I'm getting "checksum doesn't match:
Locating source for 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'. Checksum: MD5 {94 f4 4c 43 49 bd 48 fb 9a d7 b2 fc 5 e1 4e d8}
Determining whether the checksum matches for the following locations:
1: C:\Users\Oren\Desktop\FluentConfiguration.cs Checksum: MD5 {84 33 30 45 11 da 3d 40 8e 2d 3c a9 e 7c cc 14} Checksum doesn't match.
The file 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs' does not exist.
Looking in script documents for 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'...
Looking in the projects for 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'.
The file was found in a project: 'C:\Users\Oren\Desktop\FluentConfiguration.cs'.
Determining whether the checksum matches for the following locations:
1: C:\Users\Oren\Desktop\FluentConfiguration.cs Checksum: MD5 {84 33 30 45 11 da 3d 40 8e 2d 3c a9 e 7c cc 14} Checksum doesn't match.
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\atlmfc'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\crt'...
Looking in directory 'C:\Users\Oren\Desktop\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs.
The debugger could not locate the source file 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'.
Copy-pasted the fluent hibernate dlls and pdbs again, and problem was solved.
to resolve this issue. I had to add a reference to NHibernate.ByteCode.Castle.dll
The debugger is asking for one of the source files for Fluent nHibernate. You could download this because it is open source and debug it in detail, though the answer is in the InnerException.
This is probably due to a class that has not been mapped or possibly properties not being marked as virtual, or simply a database table that does not follow the standard FNH conventions. You need to get to the InnerException and read what it says as nHibernate exceptions are generally very helpful. I had plenty of trouble getting to the inner exception when I was trying to run unit tests running MSTest. I switched back to nUnit and had no trouble.
Another very useful thing to do is to output your .hbm files during the config process (FNH generates these for you behind the scenes). See Generate XML mappings from fluent Nhibernate for details. Note: I usually add a compiler directive to ensure that I only output the .hbm files in debug builds.