Apriorit Testing Team

The peculiarities of testing printer redirection in the terminal sessions

Posted on 2009-Dec-16 at 02:41 in Virtualization and Terminal Session Testing

Written by:

  Rina Krupskaya,
  Senior Tester of QA Direction
  Apriorit Inc.
http://www.apriorit.com

Content

  1. Printer redirection to the terminal  session using Microsoft tools
  2. Testing printer redirection to the terminal session
  2.1. Functional testing: checking of  redirected printers representation, printing in TS
  2.2. Non-functional testing of printer  redirection to the Terminal Server
  Conclusion

 

1. Printer redirection to the terminal  session using Microsoft tools

At the moment when  user of the thin client connects to the terminal server using Microsoft Remote Desktop  Client the client automatically transmit the information about printers  connected to the terminal. Saying terminal server (TS) in this article I mean the  server that provides clients with the computing resources - processor time,  memory, disk space - for solving their tasks. Terminal server uses this information  to automatically create printers in the user session and to establish  connection between local and network user printers. If the printer driver name matches  the name of the driver installed on the terminal server absolutely or the  driver name is present in the file ntprint.inf (there are all printer drivers  inbuilt in the installation package of the server software mentioned there), then  client printer is created automatically. In this case all documents printed to  the local printer connected to the user terminal will be successfully  transmitted via the virtual channel over the RDP between the terminal server  and thin client.

The automatic creation  is impossible when the names on the thin client and the server don’t match.  Then the following actions should be performed:

  1. Set the possibility of printer utilizing in the Remote Desktop Client  (mstsc.exe).

   

2. If users connect by means of Remote Desktop Web Connection (so called  Tsweb that can be downloaded from the Microsoft site) then this possibility  should be mentioned in the file default.html (Tsweb package includes it) and  the corresponding parameter should be set to “true”:

    MsRdpClient.AdvancedSettings2.RedirectPrinters   = True

3. In the terminal server settings Administrative Tool (tscc.msc) ->  Connections -> RDP-Tcp -> Properties the mapping of the Windows Printer shouldn’t  be disabled and the connection of the client printers at the server logon also  should be allowed.

   

4. In the user account settings (Active Directory or Windows Local  Security Accounts Manager) -> Environment -> Client Devices, the  connection of the client printers also should be enabled.

   

5. In the Group Policy settings the option “Do not allow client printer  redirection” should be enabled.

     

6. In Services Administrative Tool (services.msc) "Print Spooler  Service" should have status “Started”.

   

7. Printer shouldn’t be "Host-based printer" (so called GDI or  Windows-only Printer). "Host-based" printers, such as Hewlett Packard  Printers using LIDIL (Lightweight Imaging Device Interface Language), don’t  function in the Terminal Services environment (without utilizing the software  for printing, developed by different vendors). You can also additionally consult  your printer vendor about the support of PCL or PostScript drivers.

8. Printer driver on the terminal server should not use "printer  monitor" or so called printer utilities included in the software package  of the inexpensive printers. Such utilities (programs) are not intended for the  work in the multiuser environment such as Windows Terminal Services.

As you see the procedure described above is not very easy and requires  the certain conditions. But people always look for the easier ways to solve their  tasks.

  Now there exists software that helps to redirect client printers to the  session without installation printer drivers on TS. We’ll suppose that we should test such program.

2. Testing printer redirection to the terminal session

Let’s consider the peculiarities of testing  client printer redirection to the TS.

  To perform all tests described below we suppose that our software is  installed on the client and server. Tested software can redirect either all client  printers or ones of the specified type (only default, only network, only local). There  are local, virtual and network printers on the client machine. We  will use Desktop Connection, Remote Application,  Remote Desktop Web Connection to connect to the TS.

Let’s  formulate the test plan for our application.

2.1.  Functional testing: checking of redirected printers representation, printing in  TS

1. So, the first testing steps are focused on the  printer redirection to the session:

1.1. Default  printer redirection;

Expected result: default  printer is redirected to the session and represented as the default one. After the session finishes log off is performed.

1.2. Local  printer redirection;

Expected result:

  - If none of the local printers is default printer then in the session any  of the redirected local client printers can be represented as the default one.

  - If there is a default printer among the local printers then we check  both redirection of the local client printers and the representation of the  default printer in the session.

  - All local printers are redirected to the session.

  Attention: virtual client printers can be also redirected  to the session with the local ones.

  After the session finishes log off is performed.

1.3. Network  printer redirection;

Expected result:

  - If none of the network printers is default printer then in the session  any of the redirected network client printers can be represented as the default  one.

- If there is a default printer among the network printers then we check  both redirection of the network client printers and the representation of the  default printer in the session.

  - All network printers are redirected to the session.

  Attention: virtual client printers can be also redirected  to the session with the local ones.

  After the session finishes log off is performed.

1.4. All printers redirection;

Expected result:  check that all printers are redirected to the  session and that the default client printer is represented in the session as the  default one.

  After the session finishes log off is performed.

  In the terminal session we will see a picture  like this:

1.5. After  all printers were redirected to the TS and Printers folder was refreshed in the  session (F5), check that all printers are still redirected and the default  client printer is still represented as the default one.


2. Attend to the different printers and check their correct  redirection to the session.

    2.1. Printer with  USB interface;

    2.2. Printer  which is connected to the LPT port;

    2.3. Printer  which is connected to the COM port;

    2.4. Wireless  printer.


3. The printer redirection can be changed also “online”,  i.e. directly while the session is running and after each session reconnection.

  Let’s  consider the cases when the session is running.

                                                                                                                                                               

        Number

        of test

Pre-condition

Steps

Expected result

3.1.

1. Session is running

      2. Default    client printer is redirected to the session.

Without    closing the session change the default printer on the client side

New default printer appears in the session, it has replaced the previous default printer

3.2.

1. Session is running

      2. Default    client printer is redirected to the session.

Without closing    the session change the redirection of the default printer to the redirection    of the network printers on the client side.

1.    If none of the network printers is default printer then in the session any of    the redirected network client printers can be represented as the default one.

      2.    If there is a default printer among the network printers then we check both    redirection of the network client printers and the representation of the    default printer in the session.

      3.    All network printers are redirected to the session.

3.3.

1. Session is running

      2. Default    client printer is redirected to the session.

Without closing    the session change the redirection of the default printer to the redirection    of the local printers on the client side.

1.    If none of the local printers is default printer then in the session any of    the redirected local client printers can be represented as the default one.

      2.    If there is a default printer among the local printers then we check both    redirection of the local client printers and the representation of the    default printer in the session.

      3.    All local printers are redirected to the session.

3.4.

1. Session    is running

      2. Network    client printers are redirected to the session.

Without closing    the session change the redirection of the network printers to the redirection    of the local printers on the client side.

1.    If none of the local printers is default printer then in the session any of    the redirected local client printers can be represented as the default one.

      2.    If there is a default printer among the local printers then we check both    redirection of the local client printers and the representation of the    default printer in the session.

      3. All local    printers, instead of the network ones, are redirected to the session.

3.5.

1. Session    is running

      2. Network    client printers are redirected to the session.

Without closing    the session change the redirection of the network printers to the redirection    of the default printer on the client side.

1. If there    was a default printer among of the network printers then this default network    printer will be redirected to the session and represented as the default one.

      2. If there    was not a default printer among the network printers then the client default    printer, instead of the network printers, is redirected to the session and    represented as the default one.

3.6.

1. Session    is running

      2. Local    client printers are redirected to the session.

Without closing    the session change the redirection of the local printers to the redirection    of the default printer on the client side.

1. If there    was a default printer among of the local printers then this default local    printer will be redirected to the session and represented as the default one.

      2. If there    was not a default printer among the local printers then the client default    printer, instead of the local printers, is redirected to the session and    represented as the default one.

3.7.

1. Session    is running

      2. Local    client printers are redirected to the session.

Without closing    the session change the redirection of the local printers to the redirection    of the network printers on the client side.

1.    If none of the network printers is default printer then in the session any of    the redirected network client printers can be represented as the default one.

      2.    If there is a default printer among the network printers then we check both    redirection of the network client printers and the representation of the    default printer in the session.

      3. All network    printers, instead of the local ones, are redirected to the session.

The  described above tests can be used and for the checking redirection of the  client printers after the each session reconnection (log offdisconnect).

    Log  off — shutting down all applications working in the terminal  session, releasing all system resources, allocated for the current session (i.e.  session is completely removed from the server);

    Disconnect —  the window of terminal session is shut down on the client machine, the session  is completely stored on the server with all applications running. After the repeat  connection of this user to the server the work in the session is fully renewed  (Attention! If you finish the work of the remote desktop client by clicking  the red cross at the upper right corner of the client application then just  Disconnect will be performed).

4. The special attention should be paid on the printer  state. We simulate different printer states on the client machine and check how  the state is shown in the session.

4.1. Ready printer;

 4.2. Paused printer;

 4.3. Offline printer;


5. The  next test is aimed at the starting multiple sessions by one user (here we assume  that the TS itself supports such option).

  Let’s consider the case when a user starts two terminal sessions with redirection of all printers to the session.

  Expected result: Two  sessions contain the similar information. All client printers are redirected to  the sessions. We can see duplicated client printers in each session, the only  difference is in the unique session number (in the example on the Picture they  are 23 and 24).

 

 

6. This group of tests is to check the  correct redirection of the client printers to TS after the TS restart or client  machine restart. You may think: what so unusual can happen after  the usual restart? In truth I came across the situations when client printers  were not redirected to the TS or were redirected but not in a body.

6.1. Redirection  of all client printers after server restart.

    Expected result:  all printers are redirected to the session and  default client printer is shown as the default one.

6.2. Redirection of all client printers after client restart.

    Expected result:  all printers are redirected to the session and  default client printer is shown as the default one.


7. This test is to check the redirection of all printers from different  users - administrator, user, guest – to the TS.

    Expected result:  in all cases irrespective of what user is  logged in we assume that all printers are redirected to the session and default  client printer is shown in the session as the default one.

    

8. After  we have checked that the client printers are correctly redirected to the TS, we  can proceed to the main functionality of our application – to printing.

  Here are some points of our keen interest.

8.1. Test  of picture printing

    Expected result: 

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - picture is printed to the client  printer and corresponds to the original picture.

8.2. Test  of the printing of the text with different fonts.

  This test is very important as  far as there can be special fonts installed on the server and not installed on  the client. As the result we just won’t see the corresponding part of the text  or see it but not in the readable form.

  For example such specific  fonts are APAPA.TTF, ACUTATR_.TTF, AnnabelScript.ttf, apicture.ttf, ARIALUNI.TTF.

  Expected result: 

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - all fonts are transmitted together  with the printed document to the client printer and correspond the original  fonts.

8.3. Test  of the formula, diagram, table printing.

    Expected result:

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - formula/diagram/table is  printed on the client printer and corresponds the original one.

8.4. Test  of bar code printing.

   

    Expected result: 

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - bar code is printed on the  client printer and corresponds the original one.

8.5. Test  of printing from various account applications.

    Expected result: 

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - document sent from account  program(s) is printed on the client printer and corresponds the original one.

8.6. Test  of watermark printing.

    Expected result: 

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - watermark is printed on the  client printer and corresponds the original one.

8.7. Test  of printing of documents of different types: *.doc, *.xls, *.ppt, *.txt, *.pdf,  *.html, *.mmap (MindManager), *.jpg etc.

    Expected result: 

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - the content of all documents  of all types is printed on the client printer and corresponds the original one.

I tried to cover the main test  scenarios of printing, in truth there are a huge number of them. 


9.  On  the next stage we check how main printing options work.

    9.1. Printing  of all pages of the document;

    9.2. Printing  of selected pages;

    9.3. Printing  of several copies of the document;

    9.4. Printing  of the current page;

    9.5. Two-sided  printing;

    9.6. Printing  to the file;

    9.7. Printing  of the even-odd pages;

    9.8. Printing  of the selected range;

    9.10. Portrait oriented printing;

    9.11. LandScape oriented printing;

  Etc.

  It’s clear that the more properties  we cover the higher quality of final product we get.

 

10. The next test is to check the printing tasks  form the queue. To perform this test we send several documents to the one  printer.

    Expected result: 

  - the task has not hung in the  pool;

  - printer icon is shown not in  the session but on the client machine;

  - tasks with queue status turn  to the In Progress status one by one with following printing to the client  printer.

 

11. As  you know each user has his access rights for TS. Let’s consider two categories of  users:

  User1 is  a member of the groups:

 - administrators;

- remote desktop users.

User2 is  a member of the groups:

- users;

- remote desktop users.

We assume that each user has  some printers. When both users simultaneously redirect their printers to the  one TS and open Printers folder in their sessions they see different data.

Expected result: 

  User1 sees his printers,  server printers (if there are any) and printers of User2.

 

  User2 sees only his printers and  server printers (if there are any).

 

  Remember: User1  can’t print to the User2 printers.

2.2 Non-functional testing of printer  redirection to the Terminal  Server

12. Ideally all mentioned test scenarios should be  performed on the different configurations. Configuration list depends on the  requirements, of cause.

  The most widely spread  configuration looks as follows:

                                                                                                                                                                                                                                                                                                                                                                                                                                       

 

       

Client

Server

2003 sp2

      x32

2003 sp2

      x64

2008 sp2

      x32

2008 sp2

      x64

Vista sp2

      x32

Vista sp2

      x64

Xp sp3

      x32

Xp sp3

      x64

Win7

      x32

Win7

      x64

Win    Server 2000

XP sp3 x32,

      RDP    6.0

 

 

 

 

 

 

 

 

 

 

 

XP sp3 x32,

      RDP    7.0

 

 

 

 

 

 

 

 

 

 

 

XP sp2 x64

 

 

 

 

 

 

 

 

 

 

 

Vista sp2 x32

 

 

 

 

 

 

 

 

 

 

 

Vista sp2 x64

 

 

 

 

 

 

 

 

 

 

 

Win7 x32

 

 

 

 

 

 

 

 

 

 

 

Win7 x64

 

 

 

 

 

 

 

 

 

 

 

As you understand it will take  a huge time to fill in all cells of this table. In practice we just define priorities  and adhere to them.

  Priorities depends on the  requirements. If all above mentioned OS are present in the specification then  we base on the most obvious configurations. For example the configuration TS  2003€8 with clients XP sp3 x32 RDP 6.0, Vista sp2 x32, Win7 x32 is the  highest priority and it should be passed in the first turn for the first  release version. Then we can gradually cover other platforms.

  I want to admit one more time  that such priorities should be discussed and agreed with the customer.

 

13. Let’s consider the situation when our software  has some limitations on the number of users to redirect printers to the  terminal session. This limitation can depends on the license key.

  For example only 5 users, who work  simultaneously on the Terminal Server, can redirect their printers to the  session.

  Let’s take a look at the possible  test scenarios:

                                                                                                                                                                                                       

        Number

        of test

Pre-condition

Steps

Expected result

13.1.

Five users with    our software installed have connected to the one TS.

The sixth    user with our software installed connects to the same TS.

1. Printers of    the first five users are redirected to the session.

      2. Printers    of the sixth user are not redirected to the session.

13.2.

Five users with    our software installed have connected to the one TS.

The sixth    user with our software installed connects to the same TS.

1. Printers of    the first five users are redirected to the session.

      2. Printers    of the sixth user are not redirected to the session.

 

 

One of the first    five users logs off, for example the first one.

1. Printers    of the first user are not shown on the TS after he logged off.

      2. Printers of    the 2nd, 3rd, 4th, 5th users are    shown on the TS as before.

      3. Printers of    the 6th user are not redirected to the session.

 

 

The 6th    user logs off.

The session    of the 6th user is finished.

 

 

The 6th    user connects to the TS.

Printers of the    2nd, 3rd, 4th, 5th, 6th    users are shown on the TS.

 

 

The 1st    user connects to the TS.

1. Printers of    the 2nd, 3rd, 4th, 5th, 6th    users are shown on the TS.

      2. Printers    of the 1st user are not redirected to the session.

13.3.

Three users with    our software installed connect to the one TS.

      Let them be user1,    user2, user3.

user4 and user5    connect to the same TS, they don’t have our software installed.

1. Printers of    user1, user2, user3 are redirected to the TS.

      2. Printers of    user4, user5 are not redirected.

 

 

user6 with    our software installed connects to the same TS.

Printers of user1,    user2, user3, user6 are redirected to the TS.

13.4.

Five users, who    don’t have our software installed, connect to the one TS.

      Let them be    user1, user2, user3, user4, user5.

Five more    users connect to the same TS, they have our software installed. Let them be user6, user7,    user8, user9, user10.

Printers of user6,    user7, user8, user9, user10 are redirected to the TS. 

14. We should also remember about the performance  testing.

  So  we should measure the speed of printing in the terminal session when our  software is installed. But how can we define the optimal performance level for our  application? Sometimes the numbers are specified by the customer or project manager  but much more often we have to define performance bounds ourselves.

  Using the common sense we can say  that the application has bad performance if it takes too long to print the small  document.

  We can also measure the printing  speed using Microsoft RDPRemote AppRemote Desktop  Web Connection and checking the Redirect printers option – here we  assume that the drivers of client printer are installed on the TS and our  software is not installed. This neutral situation gives us some number to  compare with the printing speed of the same documents with our software. It’s  obvious that the speed with our application should not be less than the  corresponding speed without our software, and ideally it should be greater.

15. Load  testing.

15.1. Let’s  consider how the main functionality will work in the high load conditions. For example,  continuous printing during several hours/days. To implement this we can develop  the small script to send document from the session to the client printer in the  loop.

Expected result: the  test is for check the performance (after the n-th hour/day the performance  should not become worse). And also, the printing is possible and the  corresponding task is not hung in the pool.

15.2. Different  users connect to the same TS from the one client machine and send a document to  the one client printer. Here we can check how the printing from the multiple  users to the one printer is performed.

Expected result: 

  - printing is possible for two  users;

  - the printer icon appears not  in the session but on the client PC;

  - the tasks are not hung in  the pool;

  - the tasks that have queue status  pass into In Progress status one by one with the subsequent printing to the  client printer.

16. Stress  testing.

16.1. Perform  session disconnect while the printing is going.

Expected result:  printing is stopped; after the next  connection to the server all client printers are redirected correctly and  printing is possible. Client printers are not duplicated in the session.

16.2. Perform  session log off while the printing is going.

Expected result: printing  is stopped; after the next connection to the server all client printers are  redirected correctly and printing is possible.

16.3. Restart  or reset the TS while the client printers are redirected to the session. As practice  shows after that manipulation either the client printers are duplicated in the  session or the default printer is shown incorrectly. So we check if all printers  are not duplicated and the default printer is shown correctly.

16.4. During  the redirection and/or printing process the network cable can be plugged off or  the network connection can be switched off.

Expected result: printing  is stopped; after the next connection to the server all client printers are  redirected correctly and printing is possible.

Conclusion

In this article I mentioned  the most important moments of testing of printer redirection to the terminal  session.

  Of cause you can say that not  everything is taken into account and you can propose much more testing scenarios.  It’s good and it’s true – I based only on my experience and peculiarities of my  projects.

  I wish you a lot of successful  releases! And let your products will be of high quality!


Last Page | Page 1 of 2 | Next Page

Friends