Saturday, 1 November 2014

Learn QTP Core Concepts

Hello there - On this Page, you will find all concepts of QTP (UFT).

QTP (UFT) Specific Concepts
  1. Object Repository in QTP
  2. Descriptive Programming
  3. QTP Test Settings
  4. Recovery Scenario in QTP
  5. Datatable in QTP
  6. Utility Objects in QTP
  7. Taking a screenshot in QTP
  8. Adding Standard Checkpoints in QTP
  9. Understanding Output Value in QTP
  10. Transactions in QTP
  11. Regular Expression Evaluator in QTP
  12. Code to view associated library file in QTP
  13. How to open website in any browser in QTP
  14. Loading ini file in QTP
  15. Folder structure and File extensions in QTP
  16. Difference between QTP 10 and QTP 11

QTP, VBScript, WSH and Windows PowerShell
  1. Error Handling in QTP
  2. File System Object
  3. Dictionary Object
  4. Defining Arrays in QTP
  5. Array and Dictionary in QTP
  6. Regular Expressions in QTP
  7. QTP and Databases
  8. Web Application Testing using HTML DOM in QTP
  9. String handling in QTP
  10. Date and Time in QTP
  11. Maths functions in QTP
  12. Classes in Vbscript and QTP
  13. Data Type Conversions in VBScript
  14. Msgbox function in VBScript
  15. Round, int and fix in VBScript
Miscellaneous Topics
You may also be interested in
  1. Selenium + Java Tutorial
  2. Selenium + C#.Net Tutorial
You may also like non-technical stuff :)

  1. How to double your money

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

QTP and Date Time functions

Hello there - Please find below various questions related to date and time manipulation in QTP.
  1. How to extract date part from timestamp in QTP?
  2. How to find the name of month of given date in QTP?
  3. How to extract time part from given date in QTP?
  4. How to extract the second part from given time stamp in QTP?
  5. Explain dateadd function in qtp with Example.
  6. How to find future date in qtp?
  7. How to get the system date in qtp?
  8. How to verify the date format in qtp?
  9. How to find the yesterday's date in qtp
  10. How to find the date difference in qtp
  11. How to get the current system date in qtp?
  12. How to get the current year in qtp?
  13. How to find the name of week day for given date in QTP?
  14. Explain now function in qtp.
  15. Explain the datediff function in qtp.
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

QTP and Database Testing

We can verify values from any data bases like Microsoft Access, Excel, SQL Server using QTP.
Please follow below links to see the examples.

  1. Connecting to MS Access DB
  2. Connecting to Excel
  3. Connecting to SQL Server
  4. Insert the data into database in QTP.
  5. SQL-QTP questions.

I will be adding more examples here soon.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Sunday, 5 October 2014

What is the difference between QTP (UFT) and Selenium?

QTP and Selenium are the most popular automation testing tools in the testing industry.

Please find below the difference between QTP and Selenium below.

  1. QTP can be used to automate desktop and web applications developed in .Net, Java, VB.Net, Siebel, Peoplesoft etc. But Selenium can be used to automate only web applications.
  2. QTP is a licensed tool developed by HP. While Selenium is an open source tool.
  3. QTP only supports vb scripting. Selenium automation can be done using Java, .Net, PHP, Python, Ruby.
  4. In QTP, there is a concept of object repository to store the objects in the application. In selenium there is no such concept. In Selenium we can identify elements in the web page using xpath, css selectors etc.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Sunday, 6 July 2014

How to click on the buttons in table cells in QTP?

In software testing projects, many times we come across situations where we have to perform the operation on the objects relative to other objects. For example - in below table we have three view buttons. So to click on the view button for given emp id, you will have to first find the row number in which that emp id exists and then click on the view button in that row.
                     Emp Id                                Action                     
78989
7777
9999

We can use HTML DOM concept to handle such situations.
We can find the TD element which contains employee id say 7777. After this, we can use nextSibling property of the TD element to get the Next TD element and then find the child object (Button) of that TD using getElementsByName method.

In windows based applications, we can use relative identifier (Supported in QTP 11.5 onwards and UFT).

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to connect to sql server in QTP

Connecting to sql server is easy in QTP. In below example, we have connected to sql server.
The name of database is empdb. We have created a DSN called sqlserver.

'fetch data from database
Set db = createobject("ADODB.Connection")
'open the connection to empdb database.

db.Open "DSN=sqlserver;Database=empdb"
'create record set object

Set rst = createobject("ADODB.Recordset")
'fire the query

rst.Open "select * from emp", db,3
id = rst.RecordCount
For i=0 to id-1
'read data from table

print rst.fields(0) & rst.fields(1)
rst.Movenext
Next

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Tuesday, 24 June 2014

Online Training for QTP in India, USA, UK, Europe, Australia, New Zealand

Hello friends,
                    If you want to learn QTP quickly, you can attend the online classes/tutions. Please find more details about online training of QTP.

QTP Online Training features
  1. We will have interactive sessions via online meetings with video conferencing.
  2. To register for the online course, you have to send an email to reply2sagar@gmail.com
  3. Further details will be sent to you after your registration is confirmed.
  4. You can ask questions during the session and clarify your doubts.
  5. You should have a headset and computer with Internet Connection.
  6. Live training will be given on QTP.
  7. Cost of the training will be $250
QTP Syllabus
There will be 8 sessions of 1 hour each as mentioned below
  1. QTP Basics, GUI, Record and Playback, Actions and Tests, Test Settings in QTP. 
  2. Object Spy, Object Identification Mechanism, Object Repository (Local and Shared). 
  3. QC - QTP - Connection, Checkpoints and output values, OR Manager, Recovery Scenarios.
  4. Description Programming in QTP - Static and Dynamic, Datatable object, Debugging in QTP. 
  5. Excel Programming in QTP, Working with Databases in QTP.
  6. QTP and VB Scripting, Utility Objects in QTP.
  7. File Handling in QTP, Sending mails, Regular Expression in QTP, Other automation tools
  8. Frameworks in QTP.
Timings and Duration
  1. New batch starts every Saturday.
  2. Each class will be of 1 hour.
  3. Timing is 9 PM India time everyday except Monday.
  4. There will be total 8 sessions.
Get In touch with me by Gmail, Facebook, What's app, Skype.

Gmail                reply2sagar@gmail.com
Skype               revert2sagar
Facebook         https://www.facebook.com/sagar.salunke.186
What's app       +919850182384

Cities which we cover are given below
  1. India - Pune, Bangalore, Chennai, Delhi, Mumbai, Hyderabad, Kolkata
  2. USA - New York, New Jersey,Boston, Chicago, Houston, Philadelphia, Phoenix, San Antonio, San Diego, Dallas, San Jose, Austin, Indianapolis, San Francisco, Detroit, El Paso, Memphis, Seattle, Denver, Washington, Nashville, Baltimore,Louisville, Portland, Las Vegas, Milwaukee, Albuquerque, Tucson, Fresno, Sacramento, Long Beach, Kansas City, Mesa, Virginia Beach, Atlanta, Colorado Springs, Omaha, Raleigh, Miami, Oakland, Minneapolis, Tulsa, Cleveland, Wichita, Arlington, New Orleans, Bakersfield, Tampa, Honolulu, Aurora, Anaheim, Santa Ana, St. Louis, Riverside, Corpus Christi, Lexington, Pittsburgh, Anchorage, Stockton, Cincinnati, Saint Paul, Toledo, Greensboro Newark, Plano, Henderson, Lincoln, Buffalo, Jersey City, Chula Vista, Fort Wayne, Orlando, St. Petersburg, Chandler, Laredo, Norfolk, Durham, Madison, Lubbock, Irvine, Winston–Salem, Glendale, Garland, Hialeah, Reno, Chesapeake, Gilbert, Baton Rouge, Irving, Scottsdale, North Las Vegas, Fremont, Boise, Richmond, San Bernardino, Birmingham, Spokane Rochester, Des Moines, Modesto, Fayetteville, Tacoma, Oxnard, Fontana, Columbus, Montgomery, Moreno Valley, Shreveport, Aurora, Yonkers, Akron, Huntington Beach, Little Rock, Augusta, Amarillo, Glendale, Mobile, Grand Rapids, Salt Lake City, Tallahassee, Huntsville, Grand Prairie, Knoxville, Worcester, Newport News, Brownsville, Overland Park, Santa Clarita, Providence, Garden Grove, Chattanooga, Oceanside, Jackson, Fort Lauderdale, Santa Rosa, Rancho Cucamonga, Port St. Lucie, Tempe, Ontario, Vancouver, Cape Coral, Sioux Falls, Springfield, Peoria, Pembroke Pines, Elk Grove, Salem, Lancaster, Corona, Eugene, Palmdale, Salinas, Springfield, Pasadena, Fort Collins, Hayward, Pomona, Cary, Rockford, Alexandria Escondido, McKinney, Kansas City, Joliet, Sunnyvale, Torrance, Bridgeport, Lakewood, Hollywood, Paterson, Naperville, Syracuse Mesquite, Dayton, Savannah, Clarksville, Orange, Pasadena, Fullerton, Killeen, Frisco, Hampton, McAllen, Warren Bellevue, West Valley City, Columbia, Olathe, Sterling Heights, New Haven, Miramar, Waco, Thousand Oaks, Cedar Rapids, Charleston, Visalia, Topeka, Elizabeth, Gainesville, Thornton,Roseville, Carrollton, Coral Springs, Stamford,Simi Valley,Concord,Hartford, Kent, Lafayette,Midland,Surprise,Denton,Victorville,Evansville, Santa Clara,Abilene,Athens,Vallejo,Allentown,Norman,Beaumont, Independence,Murfreesboro,Ann Arbor,Springfield,Berkeley, Peoria,Provo,El Monte,Columbia,Lansing,Fargo,Downey,Costa Mesa Wilmington, Arvada,Inglewood, Miami Gardens, Carlsbad, Westminster, Rochester, Odessa,Manchester,Elgin, West Jordan,Round Rock, Clearwater, Waterbury, Gresham,Fairfield,Billings,Lowell,Ventura,Pueblo,High Point, West Covina,Richmond,Murrieta,Cambridge,Antioch,Temecula,Norwalk,Centennial, Everett,Palm Bay,Wichita Falls,Green Bay,Daly City,Burbank,Richardson, Pompano Beach,North Charleston,Broken Arrow,Boulder,West Palm Beach, Santa Maria,El Cajon,Davenport,Rialto,Las Cruces,San Mateo,Lewisville, South Bend,Lakeland,Erie,Tyler,Pearland,College Station
  3. UK - London, Bath, Birmingham, Bradford, Bristol, Sheffield, Nottingham, Liverpool, Tyneside, Hampshire, Glasgow, Yorkshire, Midlands, Manchester, Bristol, Belfast, Edinburgh, Brighton, Dorset, Leicester, Portsmouth, Reading, Teesside, Potteries.
  4. Australia - Sydney, Melbourne, Perth, Brisbane, Perth, Adelaide, Gold Coast, New Castle, Canberra, Sunshine Coast,Wollongong, Hobart, Geelong, Townsville, Cairns, Darwin, Toowoomba, Ballarat, Bendigo, Launceston, Albury-Wodonga, Mackay, Rockhampton, Bundaberg, Bunbury, Coffs Harbour, Wagga Wagga, Hervey Bay, Mildura-Wentworth, Shepparton-Mooroopna, Gladstone-Tannum Sands,  Port Macquarie, Tamworth, Traralgon-Morwell, Orange, Geraldton, Bowral-Mittagong, Dubbo, Nowra-Bomaderry, Bathurst, Warrnambool, Kalgoorlie-Boulder, Busselton, Albany, Warragul-Drouin, Devonport
  5. New Zealand - Auckland, Wellington, Hamilton, Tauranga, Christchurch, Napier-Hastings, Dunedin, Palmerston North, Nelson, Rotorua, New Plymouth, Whangarei
  6. Singapore - South West, Central, North West
  7. Canada - Toronto, Montreal, Vancouver, Edmonton, Winnipeg, Calgary, Ottawa–Gatineau, Quebec
  8. Germany- Berlin, Hamburg, Munich, Cologne, Frankfurt, Stuttgart, Dusseldorf, Dortmund, Essen, Bremen, Dresden, Leipzig, Hannover, Nuremberg, Duisburg, Bochum, Wuppertal, Bonn, Bielefeld, Mannheim, Karlsruhe, Munster, Warragul-Drouin, Wiesbaden, Augsburg, Aachen, Mönchengladbach, Gelsenkirchen, Braunschweig, Chemnitz, Kiel, Krefeld, Halle, Freiburg, Magdeburg, Oberhausen, Lubeck, Erfurt, Rostock, Mainz, Kassel, Hagen, Hamm, Mulheim-an-der-Ruhr, Saarbrucken, Herne, Ludwigshafen-am-Rhein, Osnabruck, Oldenburg, Leverkusen, Solingen, Potsdam, Neuss, Heidelberg, Paderborn, Darmstadt, Regensburg, Wurzburg, Ingolstadt,  Heilbronn, Ulm, Gottingen, Wolfsburg, Offenbach-am-Main, Pforzheim, Recklinghausen, Bottrop,  Furth,Bremerhaven,Reutlingen,Remscheid,Koblenz,Bergisch-Gladbach,Trier, Erlangen, Moers, Jena, Salzgitter, Siegen, Cottbus, Hildesheim.
  9. France- Paris, Marseille, Lyon, Toulouse, Nice, Nantes, Strasbourg, Montpellier, Bordeaux, Lille, Rennes, LeHavre, Reims, Saint-Etienne, Toulon, Grenoble, Angers, Dijon, Brest, Le-Mans, Clermont-Ferrand, Amiens, Aix-en-Provence, Limoges, Nîmes, Tours, Saint-Denis, Villeurbanne, Metz, Besancon, Caen, Orleans, Mulhouse, Rouen, Boulogne-Billancourt, Perpignan, Nancy, Roubaix, Fort-de-France, Argenteuil, Tourcoing, Montreuil, Saint-Paul, Avignon, Saint-Denis, Versailles, Nanterre, Poitiers, Creteil, Aulnay-sous-Bois, Vitry-sur-Seine, Pau, Calais, Colombes, La-Rochelle, Asnieres-sur-Seine.
  10. Spain-Madrid, Barcelona, Valencia, Seville, Bilbao, Malaga, Oviedo–Gijon–Aviles, Alicante–Elche, Las-Palmas, Zaragoza, Murcia–Orihuela, Palma, Vigo, Cartagena, Cadiz, San-Sebastian, Valladolid, Tarragona, Cordoba, Pamplona, Alzira–Xativa, Vitoria-Gasteiz, Huelva, Almería, Salamanca, León, Albacete, Jaen–Martos, Burgos, Logrono, Ferrol–Narón, Lleida, Girona–Salt, Badajoz, Ourense, Benidorm, Gandia, Blanes, Manresa, Marbella, Torrelavega, Vic–Manlleu, Guadalajara, Lugo, Palencia,Toledo.
  11. Russia - Moscow, Saint, Petersburg, Novosibirsk, Yekaterinburg, NizhnyNovgorod, Samara, Kazan, Omsk, Chelyabinsk, Rostov-na-Donu, Ufa, Volgograd, Perm, Krasnoyarsk, Voronezh, Saratov, Tolyatti, Krasnodar, Izhevsk, Yaroslavl.
  12. Sweden - Stockholm, Gothenburg, Malmo,Uppsala, Linkoping, Vasteras, Orebro, Norrkoping, Helsingborg, Jonkoping, Lund, Umea, Gavle, Boras, Eskilstuna, Sodertalje, Karlstad, Taby, Vaxjo, Halmstad.
  13. Belgium - Antwerp, Ghent, Charleroi, Liege, Brussels, Bruges, Schaerbeek, Anderlecht, Namur, Leuven, Mons, Mechelen, Ixelles, Aalst, Uccle, La-Louviere, Hasselt, Kortrijk, Sint-Niklaas, Ostend, Tournai, Genk, Seraing, Roeselare, Mouscron, Verviers, Forest, Saint-Gilles, Jette, Beveren, Etterbeek, Dendermonde, Beringen, Turnhout, Vilvoorde, Dilbeek, Lokeren, Sint-Truiden, Herstal, Geel, Ninove, Maasmechelen, Brasschaat, Halle, Waregem, Chatelet, Grimbergen, MolYpres, Lier, Evergem, Schoten, Knokke-Heist, Lommel, Wavre, Tienen, Binche, Geraardsbergen, Menen, Bilzen, Wevelgem.
  14. Switzerland - Zurich, Geneva, Basel, Lausanne, Bern, Lucerne, Winterthur, St-Gallen, Lugano, Biel, Thun, Köniz, La-Chaux-de-Fonds, Schaffhausen, Fribourg, Vernier, Chur, Neuchâtel, Uster, Sion, Kriens.
  15. Denmark - Copenhagena, Aarhus, Odense, Aalborgb, Frederiksberga, Esbjerg, Gentoftea, Gladsaxea, Randers, Kolding, Horsens, Lyngby-Taarbæka, Vejle, Hvidovrea, Roskilde, Helsingor, Herning, Silkeborg, Naestved, Greve-Stranda, Tarnbya, Fredericia, Ballerupa, Rodovrea, Viborg, Koge, Holstebro, Brondbya, Taastrupa, Slagelse, Hillerød, Albertslunda, Sonderborg, Svendborg, Herleva, Holbaek, Hjorring, Horsholm, Frederikshavn, Glostrupa, Haderslev, Norresundbyb, Ringsted, Skive.
  16. Greece - Athens, Thessaloniki, Patras, Piraeus, Larissa, Heraklion, Peristeri, Kallithea, Acharnes, Kalamaria, Nikaia, Glyfada, Volos, Ilio, Ilioupoli, Keratsini, Evosmos, Chalandri, Nea-Smyrni, Marousi, Agios-Dimitrios, Zografou, Egaleo, Nea-Ionia, Ioannina, Palaio-Faliro, Korydallos, Trikala, Vyronas, Agia-Paraskevi , Galatsi, Chalcis, Petroupoli, Serres, Alexandroupoli, Xanthi, Katerini, Kalamata, Kavala, Chania, Lamia , Komotini, Irakleio, Rhodes, Kifissia, Agrinio, Stavroupoli, Chaidari, Drama.
  17. Georgia - Tbilisi, Kutaisi, Batumi, Rustavi, Zugdidi, Gori, Poti, Samtredia, Khashuri, Senaki, Zestafoni,Marneuli, Telavi, Akhaltsikhe, Kobuleti, Ozurgeti, Tsqaltubo, Kaspi, Gardabani, Chiatura, Tqibuli, Borjomi, Sagarejo, Bolnisi, Khoni, Gurjaani, Akhalkalaki .
  18. Italy - Rome, Milan, Naples, Turin, Palermo, Genoa, Bologna, Florence, Bari, Catania, Venice, Verona, Messina, Padua, Trieste, Taranto, Brescia, Prato, Reggio-Calabria, Modena, Parma, Perugia, Reggio, Livorno, Ravenna, Cagliari, Foggia, Rimini, Salerno, Ferrara, Sassari, Syracuse, Pescara, Monza, Latina, Bergamo, Forlì, Trento, Vicenza, Terni, Novara, Bolzano, Piacenza, Ancona, Arezzo, Andria, Udine, Cesena, Lecce, La-Spezia, Pesaro, Alessandria, Barletta, Catanzaro, Pistoia, Brindisi, Pisa, Torre-del-Greco, Como, Lucca, Guidonia-Montecelio, Pozzuoli, Treviso, Marsala, Grosseto, Busto.
  19. Turkey - Istanbul, Ankara, Izmir, Bursa, Adana, Gaziantep, Konya, Antalya, Kayseri, Mersin, Eskişehir, Diyarbakır, Samsun, Denizli, Şanlıurfa, Adapazarı, Malatya, Kahramanmaraş, Erzurum, Van, Batman,  Elazıg, Izmit, Manisa, Sivas, Gebze, Balıkesir, Tarsus, Kutahya, Trabzon, Corum, Corlu, Adıyaman, Osmaniye, Antakya, Aydın, Iskenderun, Usak, Aksaray, Afyon, Isparta, Inegol, Tekirdag, Edirne, Darıca, Ordu, Karaman.
  20. Iceland - Reykjavík, Kopavogur, Hafnarfjorour, Akureyri, Keflavík, Garoabær, Mosfellsbær, Akranes, Selfoss, Njarovík, Seltjarnarnes, Vestmannaeyjar, Grindavík, Sauoarkrokur, Ísafjorour, Alftanes, Hverageroi, Egilsstaoir, Husavík, Borgarnes, Sandgeroi, Hofn, Porlakshofn, Dalvík, Garour, Neskaupstaour, Siglufjorour, Reyoarfjorour, Vogar, Stykkisholmur, Eskifjorour, Olafsvik.
  21. Ireland - Dublin, Ennis, Cork, Kilkenny, Limerick, Tralee, Galway, Carlow, Waterford, Newbridge, Drogheda, Naas, Dundalk, Athlone, Swords, Portlaoise, Bray, Mullingar, Navan, Wexford.
  22. Ukraine - Kyiv, Kharkiv, Dnipropetrovsk, Odesa, Donetsk, Zaporizhia, Lviv, Kryvyi Rih, Mykolaiv, Mariupol, Luhansk, Makiivka, Vinnytsia, Simferopol, Sevastopol, Kherson, Poltava, Chernihiv, Cherkasy, Sumy, Horlivka, Zhytomyr, Dniprodzerzhynsk, Kirovohrad, Khmelnytskyi, Rivne, Chernivtsi, Kremenchuk, Ternopil, Ivano-Frankivsk, Lutsk, Bila Tserkva, Kramatorsk, Melitopol, Kerch, Nikopol, Sloviansk, Berdiansk, Sieverodonetsk, Alchevsk, Pavlohrad, Uzhhorod, Lysychansk, Yevpatoria, Yenakiieve, Kamianets-Podilskyi, Kostiantynivka, Krasnyi-Luch, Oleksandriia.
  23. Poland - Warszawa, Krakow, Lodz, Wroclaw, Poznan, Gdansk, Szczecin, Bydgoszcz, Lublin, Katowice, Białystok, Gdynia, Czestochowa, Radom, Sosnowiec, Toruń, Kielce, Gliwice, Zabrze, Bytom, Olsztyn, Bielsko-Biala, Rzeszow, Ruda-Sląska, Rybnik, Tychy, Dąbrowa-Gornicza, Plock, Opole, Elbląg, Gorzow-Wielkopolski, Walbrzych, Wlocławek, Zielona-Gora, Tarnow, Chorzow, Kalisz, Koszalin, Legnica, Grudziądz, Slupsk, Jaworzno, Jelenia Gora, Nowy Sącz, Konin, Siedlce, Lubinm, Inowroclaw, Myslowice, Pila, Pabianice, Gniezno, Suwalki, Glogow, Chelm, Przemysl, Zamosc, Leszno, Lomza, Zory, Belchatow, Mielec, Tarnowskie-Gory, Tczew, Swidnica, Bedzin, Zgierz, Biala-Podlaska, Raciborz, Elk, Pruszkow, Swietochlowice, Ostroleka, Starachowice, Zawiercie, Legionowo, Tarnobrzeg, Pulawy, Wodzislaw-Sląski, Radomsko
  24. Netherlands - Amsterdam, Enschede, Rotterdam, Apeldoorn, The Hague, Haarlem, Utrecht, Amersfoort, Eindhoven, Zaanstad, Tilburg, Arnhem, Groningen, Haarlemmermeer, Almere, Breda, Zoetermeer, Nijmegen, Zwolle.
  25. Romania - Bucharest, Cluj-Napoca, Timișoara, Iasi, Constanța, Craiova, Brașov, Galați, Ploiesti, Oradea, Braila, Arad, Pitesti, Sibiu, Bacau, Targu-Mureș, Baia-Mare, Buzau, Botosani, Satu-Mare, Ramnicu-Valcea, Drobeta-Turnu-Severin, Suceava, Piatra-Neamț, Targu-Jiu, Targoviste, Focsani, Bistrița, Tulcea, Resița, Slatina, Calarasi, Alba-Iulia, Giurgiu, Deva, Hunedoara, Zalau, Sfantu-Gheorghe, Barlad, Vaslui, Roman, Turda, Medias, Slobozia, Alexandria, Voluntari, Lugoj, Medgidia, Onesti, Miercurea-Ciuc, Sighetu-Marmatiei.
  26. Kazakhstan - Aktau, Aktobe, Almaty, Arkalyk,Astana, Atyrau, Baikonur, Balqash, Zhezkazgan, Karagandy, Kentau,  Kyzylorda, Kokshetau, Kostanay, Zhanaozen, Pavlodar, Petropavl, Ridder, Saran, Satpayev, Semey, Stepnogorsk, Taldykorgan, Taraz, Temirtau, Turkistan, Oral, Oskemen, Shymkent, Shahtinsk, Shuchinsk, Ekibastuz.
  27. Hungary  - Budapest, Debrecen, Miskolc, Szeged, Pecs, Gyor, Nyíregyhaza, Kecskemet, Szekesfeharvar, Szombathely, Szolnok, Tatabanya, Kaposvar, Erd, Veszprem, Bekescsaba, Zalaegerszeg, Sopron, Eger, Nagykanizsa. 
  28. Portugal  - Lisbon, Agualva-Cacem, Sintra, Queluz, Vila-Nova-de-Gaia, Guimaraes, Porto, Viseu, Braga, Rio-Tinto, Amadora, Aveiro, Funchal, Odivelas, Coimbra, Matosinhos, Setubal, Amora, Almada, Ponta-Delgada.
  29. Bulgaria - Sofia, Plovdiv, Varna, Burgas, Ruse, Stara-Zagora, Pleven, Sliven, Dobrich, Pernik, Shumen, Haskovo, Yambol, Pazardzhik, Blagoevgrad, Veliko-Tarnovo, Vratsa, Gabrovo, Asenovgrad, Vidin.
  30. Azerbaijan  - Baku, Khachmaz, Sumqayit, Agdam, Ganja, Jalilabad, Mingachevir, Khankandi, Lankaran, Shirvan, Nakhchivan, Shamkir, Shaki, Yevlakh.
  31. Belarus - Minsk, Barysaw, Salihorsk, Maladzyechna, Vitsyebsk, Orsha, Navapolatsk, Polatsk, Mahilyow, Babruysk, Homyel, Mazyr, Zhlobin, Brest, Baranavichy, Pinsk, Hrodna, Lida.
  32. Slovakia - Bratislava, Prievidza, Kosice, Zvolen, Presov, Povazska-Bystrica, Zilina, Banska-Bystrica, Nitra, Trnava, Martin, Trencín, Poprad.
  33. Croatia - Zagreb, Split, Rijeka, Osijek, Zadar, Pula, Slavonski-Brod, Karlovac, Varazdin, Sibenik, Sisak, Vinkovci, Velika-Gorica.
  34. Moldova - Chisinau, Tiraspol, Balti, Bender, Ribnita, Cahul, Ungheni.
  35. Serbia  - Belgrade, Novi-Sad, Nis, Kragujevac, Subotica, Zrenjanin, Pancevo, Cacak, Novi -Pazar, Kraljevo, Smederevo, Leskovac, Valjevo, Krusevac, Vranje, Sabac, Uzice, Sombor, Pozarevac, Pirot.
  36. Macedonia - Skopje, Bitola, Kumanovo, Prilep, Tetovo, Veles, Stip, Ohrid, Gostivar, Strumica.
  37. Finland - Helsinki, Espoo, Tampere, Vantaa, Oulu, Turku, Jyvaskyla, Kuopio, Lahti, Kouvola, Pori, Joensuu, Lappeenranta, Hameenlinna, Vaasa, Rovaniemi, Seinajoki, Salo, Kotka.
  38. Armenia - Yerevan, Charentsavan, Gyumri, Vanadzor, Vagharshapat, Hrazdan, Abovyan, Kapan, Armavir, Gavar, Artashat.
  39. Norway - Oslo, Bergen, Stavanger, Trondheim, Kristiansand, Sarpsborg, Drammen, Skien, Tromso.
  40. Montenegro - Podgorica, Niksic, Pljevlja, Bijelo-Polje.
  41. Latvia - Riga, Vilnius, Tallinn, Kaunas, Klaipėda, Siauliai, Tartu, Panevezys, Daugavpils.
  42. Albania - Tirana, Durres, Vlore, Elbasan, Shkoder, Fier, Korce, Gjirokaster.
  43. Slovenia -  Ljubljana, Celje, Kranj, Velenje, Koper.
  44. Estonia - Tallinn, Tartu, Narva, Parnu, Kohtla-Jarve.
  45. Lithuania - Vilnius, Kaunas, Klaipeda, Siauliai, Panevezys.
  46. Cyprus - Nicosia, Limassol, Larnaca, Paphos, Kyrenia, Famagusta.
  47. Kosovo - Pristina, Prizren, Ferizaj, Pec, Gjakova, Gnjilane, Podujevo, Mitrovica, Vucitrn, Suva-Reka, Glogovac, Lipljan, Orahovac, Malisevo, Skenderaj, Vitina, Decan.
  48. Luxembourg - Luxembourg-City, Esch-sur-Alzette, Dudelange.
  49. Northern-Cyprus - North-Nicosia, Famagusta, Kyrenia.
Many Professionals have found this online course very useful to learn the important concepts of QTP. So if you wanna add extra skill to your resume, you can join this class. You have to just send an email to reply2sagar@gmail.com

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Thursday, 15 May 2014

QTP job openings in Pune

If you are looking for QTP/Selenium job in pune, you can contact me at reply2sagar@gmail.com.

Job Location-
    Pune/Bangalore/Delhi

Job Description -
  1. Good understanding of Testing Concepts.
  2. Should be able to develop QTP framework.
  3. Banking and Finance experience is preferred.
  4. Should know QC and other test management tools.
  5. Should be good at test design and execution.
  6. Should know about test reporting.
Experience Level 
2-8 years of experience is required.

Companies having job openings.
  1. Wipro
  2. Cognizant
  3. Sungard
  4. Infosys
  5. Tech Mahindra.
QTP Interview and Selection Process-

Please make sure that you read all the topics on this blog before you forward your resume to me. I have covered all QTP concepts on this blog. Once you are confident about QTP, then you can send me your resume. Please make sure that resume file name should be in the below format.

Name_TotalExp_Skill_Domain_currentlocation   E.g. Sagar_3.2years_QTP_Banking_Pune.
  1. I will send your resume to recruitment team. 
  2. I will also upload your resume in the company database.
  3. You will get the mail asking you to upload your resume.
  4. Then you will get an interview call.
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Friday, 18 April 2014

What is UFT?

UFT stands for unified functional testing.
UFT is the product from HP which was earlier known as  Quick Test Professional (QTP).
UFT 12.0 is the latest stable version which was released in march 2014.

All concepts of QTP are same.

Some additional features of UFT 12.0 are given below.

  1. Stylish GUI
  2. Built-In support for Internet Explorer 8, 9, 10 and 11
  3. Built in Support for Chrome and Firefox
  4. Installation is very fast as compared to earlier versions of QTP.
  5. QC connectivity is renamed as ALM (Application Lifecycle Management) connectivity.
  6. Print statement generates the log in embedded log window instead of separate window. 

If you are preparing for an UFT interview , you can visit below links.

  1. UFT interview Questions and Answers -Advanced-1
  2. UFT interview Questions and Answers -Advanced-2
  3. Keyword Driven Framework in UFT
  4. UFT Tutorial
Remember that all basic concepts of QTP are same in UFT as well. It is just another new version of QTP tool by HP.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Thursday, 20 February 2014

How to find the column number for given column name in webtable in QTP?

Below QTP example shows how we can find out the column position/number for the given column name in the webtable using QTP.

Suppose you know the column name as "Quantity", then you can get it's position using below line of code.
Below function will return the position of the given column in the table. If the column is not found in the table, -1 is returned.

print GetColumnNumber(ObjParent.Webtable("mytable"), "Quantity")


Function GetColumnNumber(byval table, byval columnName)


Result = false

intColumnCount = table.ColumnCount(1)
print "row count " & intColumnCount

For j = 1 to intColumnCount
curColumn =table.GetCellData (1, j)
print curColumn

'It is important to remove the extra spaces using trim function to match the column name properly  
If ucase(trim(columnName)) = ucase(trim(curColumn)) Then
GetColumnNumber=j
Exit Function
        end if
next

GetColumnNumber = -1 

End Function


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to create random strings in QTP?

Sometimes we need to create the test data randomly  in the form of strings (numerical, alphanumerical and alphabetical) at run time. I have created one function that will give you random strings.

'to get only alphabetical strings, pass 1 as input
print getRandomString(1)

'to get only alphanumerical strings , pass 2 as input
print getRandomString(2)

'to get only numerical strings , pass 3 as input
print getRandomString(3)

Function getRandomString(byval intType)

stamp = replace(replace(formatdatetime(now),":","-"),"/","")
stamp = replace(stamp,"-","")
stamp = replace(stamp," ","")

If intType = 1 Then
'only alphbetical
For i=1 to 8
Randomize 
x = x & chr( Int((90-65+1)*Rnd+65))
Next

elseIf intType = 2 Then
' alphanumeric
x = "AN" + stamp

elseIf intType = 3 Then
' only digits
x  = stamp

End If
        getRandomString = x

End Function

All the strings will be unique as they are based on time stamp.
Some of the testing scenarios where you will need such function are given below.

  1. Some times users are allowed to save the profile settings which can be loaded later on. In this case, we need to create such profile names that are unique. 
  2. Some times we need to create the entity names which are unique. For example - creating the group Ids, User Ids etc.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to close all processes with given name in QTP?

While testing the applications with automation, we need to close existing applications and then start new one to avoid a clash.

Below example demonstrates how we can close all processes with given name.

Suppose if you want to close all excel processes, then you can use below code.
Call closeProcessByName("excel.exe")

Suppose if you want to close all internet explorer browser processes, then you can use below code.
Call closeProcessByName("iexplore.exe")

In similar way you can close any process given that you know the name of process

Sub closeProcessByName(byval process_name)

sComp = "."

'Get the WMI object
Set WMI = GetObject("winmgmts:\\" &  sComp &  "\root\cimv2")

'Get collection of processes with process_name like excel.exe, iexplore.exe

 Set allp = WMI.ExecQuery("Select * from Win32_Process Where Name = '" & process_name & "'")

'terminate each process
For Each p  in allp
p.Terminate()
Next 

End Sub


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to find the total number of rows in the webtable in QTP?

We can find the count of rows in the table in QTP using 3 ways as mentioned below.

  1. using rowcount property of QTP webtable object
  2. using GetROProperty of QTP
  3. using HTML DOM + QTP

using rowcount property of QTP webtable object
print  objParent.webtable("html id:=myTable").RowCount

using GetROProperty of QTP
print  objParent.webtable("html id:=myTable").GetROProperty("rows")

using html DOM + QTP
print  objParent.webtable("html id:=myTable").Object.rows.length

This is how you can get the total number of rows in the given table in QTP.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to find all items from the weblist in QTP?

Below example illustrates how We can get the all items from the drop down in QTP.

arrWeblistItems = split(objParent.weblist("name:=listType").GetROProperty("all items"),";")

'print total number of items in the listbox
print arrWeblistItems.count

For itemCounter =0 to ubound(arrWeblistItems)
'print the value in the dropdown
print arrWeblistItems(itemCounter )
Next                                                

This is how we can print the all items in the list box in QTP.

We can also get all items in the combo box using HTML DOM + QTP as shown in below code.

Set col = ObjParent.weblist("name:=tranType").object.getElementsByTagName("option")
For i=0 to col.length-1
              'print the value in each option inside combobox
             print col(i).innerText
Next


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to verify if the edit box is enabled or disabled in QTP?

We can easily check if the given web object like edit box, listbox, weblist, webbutton, webcheckbox is enabled or disabled using 2 ways in QTP 

1. Example - Using getROProperty method of QTP
Below example uses the GetROProperty method to find the checkbox status

status = Browser("ABC").Page("Mypage").WebEditBox("myedit").GetROProperty("Disabled")

If the webeditbox is disabled then status will have a value - 1

If the webeditbox is enabled then status will have a value - 0

This is how we can validate if the editbox is enabled or not using QTP.

2. Example - Using HTML DOM (applies to only web applications)

status = Browser("ABC").Page("Mypage").WebEditBox("myedit").object.disabled

If the editbox is disabled then status will have a value - true

If the editbox is disabled then status will have a value - false

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to verify if the webcheckbox is selected or not in QTP?

Verifying if the web checkbox is selected or not is very easy in QTP.

Example - Using getROProperty method of QTP
Below example uses the GetROProperty method to find the checkbox status

status = Browser("ABC").Page("Mypage").WebCheckBox("mycheck").GetROProperty("Value")

If the checkbox is selected then status will have a value - ON

If the checkbox is not selected then status will have a value - OFF

This is how we can validate if the checkbox is selected or not using QTP.

Example - Using HTML DOM (applies to only web applications)

status = Browser("ABC").Page("Mypage").WebCheckBox("mycheck").object.checked

If the checkbox is selected then status will have a value - true

If the checkbox is not selected then status will have a value - false


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to Select an item from the weblist in QTP?

Selecting an item from the weblist is tricky in QTP. We have a method - select to select a specific item from the weblist.

But the item value is case sensitive. That means if you have 2 items in the list say Buy and Sell , then below code will throw an error saying can not identify the specified item of type - listType.

objParent.weblist("name:=listType").Select "BUY"  'and not Buy

But if you use below code, it will work like a charm.

objParent.weblist("name:=listType").Select "Buy"  ' and not BUY

To make the code more reliable we can use more improved code as shown below


itemToSelect = "BUY"

arrWeblistItems = split(objParent.weblist("name:=listType").GetROProperty("all items"),";")

For itemCounter =0 to ubound(arrWeblistItems)

If trim(ucase(arrWeblistItems(itemCounter))) = ucase((trim(itemToSelect))) Then
objParent.weblist("name:=listType").Select arrWeblistItems(itemCounter)
Exit for
End If

Next                                                

This is how we can select the item from the combo box in QTP regardless of case-sensitivity.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to schedule QTP script execution at night?

Well - Many a times you need to schedule the test execution with QTP at night.

I am going to explain how you can write a vbscript to run QTP test at specific period of time. You can copy below code and store it in sample vbscript file say qtptask.vbs Please do not forget to change the path of the test to execute at the first line in below code.

Now go to windows scheduler through control panel and create a new task. Give the path of the vbs file you created and set the specific time at which you want to execute the QTP scripts.

That's it. Now you can go home and relax. Your QTP scripts will run automatically at the time you specified in task.

Example to launch QTP automatically

testpath = "C:\sample-scheduled-test"

'Create the QTP Application object
Set qtApp = CreateObject("QuickTest.Application") 
qtApp.Launch 

'Make the qtp application visible
qtApp.Visible = True

'open the test you want to run 
qtApp.Open testpath , True 

'start executing the test
qtApp.Test.Run

'close the test
qtApp.Test.Close

'quit the QTP application
qtApp.quit

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

How to find all check boxes on the webpage in QTP?

In web applications, we can find the web checkbox objects in 2 ways.
  1. using QTP childobjects method
  2. using html DOM
using QTP childobjects method

Set oDesc = Description.Create()
oDesc("micclass").Value = "Webcheckbox"

'identify objects inside parent page having micclass as Webcheckbox
set col = ObjParent.childobjects(oDesc)

'print the count of checkboxes on the page.
msgbox col.count


using HTML DOM

set col = Browser("index:=0").page("index:=0").object.getElementsByTagName("input")
msgbox col.length

'Above code will give all objects starting with input tag. You can filter those having type = checkbox using below code.


For i=0 to col.length-1
If  col(i).getAttribute("type")  = "checkbox" Then
cnt = cnt +1
End If
Next


print cnt


'above code print the type attribute value. If it is checkbox , that means given control is web checkbox.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to find all web list objects on the web page in QTP?

In web applications, we can find the weblist objects in 2 ways.
  1. using QTP childobjects method
  2. using html DOM
using QTP childobjects method

Set oDesc = Description.Create()
oDesc("micclass").Value = "WebList"

'identify objects inside parent page having micclass as Weblist
set col = ObjParent.childobjects(oDesc)

'print the count of web list boxes on the page.
msgbox col.count


using HTML DOM

set col = Browser("index:=0").page("index:=0").object.getElementsByTagName("Select")
msgbox col.length


'Above code will give all objects starting with select tag - list boxes ( Drop downs) . 


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com



Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Tuesday, 18 February 2014

How to find all webedit objects on the webpage in QTP?

In web applications, we can find the webedit objects in 2 ways.

  1. using QTP childobjects method
  2. using html DOM


using QTP childobjects method

Set oDesc = Description.Create()
oDesc("micclass").Value = "WebEdit"

'identify objects inside parent page having micclass as Webedit
set col = ObjParent.childobjects(oDesc)

'print the count of edit boxes on the page.
msgbox col.count


using HTML DOM

set col = Browser("index:=0").page("index:=0").object.getElementsByTagName("input")
msgbox col.length

'Above code will give all objects starting with input tag. You can filter those having type = text using below code.


For i=0 to col.length-1
If  col(i).getAttribute("type") = "text" Then
cnt = cnt +1
End If
Next


print cnt


'above code print the type attribute value. If it is text, that means given control is edit box.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to select the radio button in the WebRadioGroup in QTP

In web applications, radio buttons are usually part of the webradiogroup.  Each webradiogroup contains specific items. We can select one item at a time.

In QTP, we can select the particular radio button using below syntax.

Browser("abc").page("xyz").WebRadioGroup("sex").Select "male"

In above code, we have a WebRadioGroup - sex (with 2 items - male and female).
Above code will select the male.

To select female radiobutton, we can use below line
Browser("abc").page("xyz").WebRadioGroup("sex").Select "female"


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to select the web checkbox in QTP?

In QTP, you can select the web checkbox using below syntax.

'Below code will select the checkbox with name - mycheck
Browser("ABC").Page("XYZ").WebCheckBox("mycheck").set "ON"

'Below code will deselect the checkbox with name - mycheck
Browser("ABC").Page("XYZ").WebCheckBox("mycheck").set "OFF"

Please note that using same method, we can select or deselect the checkbox in other applications/environments like JAVA, .Net, Delphi, Oracle, Peoplesoft, Siebel, Visual Basic.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

How to find the title of all open browsers in QTP?

Below example shows how we can handle multiple open browsers in QTP.


'Create the browser object using description.create
Set browserObject= Description.Create()
browserObject("micclass").Value= "Browser"

'using Desktop.ChildObjects find the collection of all open browsers
Set collection= Desktop.ChildObjects(browserObject)

'print the total number of open browsers in the system
print  "Total number of browsers open in the system are " & collection.Count()

Once we get total number of browsers open in the system. We can print the titles using 2 ways.


 For i =0 To (collection.Count()-1)

print  "Title of the browser no : " & ( i+1) &  " is -> " &  collection(i).GetROProperty("title")

Next

Just the another way to print the title of browsers.

 For i =0 To (collection.Count()-1)

print  "Title of the browser no : " & ( i+1) &  " is -> " &  Browser("index:=" & i).getROProperty("title")

Next

We can also print other details of  each browser like
  1. hasmenubar - returns true if browser has menu bar
  2. hasstatusbar - returns true if browser has statusbar
  3. hastoolbar - returns true if browser has toolbar
  4. hwnd - returns the handle of the browser window
  5. number of tabs - returns the count of tabs
  6. openedbytestingtool - returns true if the browser is opened by QTP
  7. opentitle - returns the open title 
  8. openurl -  returns the url
 Above code was tested on QTP 10 and Internet Explorer 10.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

Monday, 27 January 2014

How to trigger the web events like change, click, mouseup in QTP?

Testing the web application with QTP involves the biggest challenge of events bound to the html elements with jquery by developers not getting triggered. 

Example - 

Problem (Issue)

For instance, when we select the value from the web combobox (dropdown), HTML dom of the webpage changes. It may change the visibility of the some of the controls like edit boxes or drop downs. It may do some ajax calls to the server by using javascript code.
So basically when we do some operation on the web elements , specific event handlers ( java script code or function) get called. But performing the same operation with QTP may not call these event handlers leading to inability to automate the test cases.

Solutions
To handle this issue we can trigger any event like change, click, double click, mouseup, mousedown etc by using FireEvent method. But if it does not work, you can use the vbscript code as depicted below.

'Create the event object
Set evt =  Browser("ABC").Page("XYZ").Object.createEvent("HTMLEvents")

'Set the event type like change, click, mouseup, mousedown
evt.initEvent "change", true, true

'Dispatch the event on desired object.
Browser("ABC").Page("XYZ").WebList("pqr").Object.dispatchEvent(evt)

Above code was tested on internet explorer 10 and QTP 10. If you have faced similar issue while automating web application, please give details in comment and I will try to help you.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Wednesday, 22 January 2014

How to access the excel as a database using adodb.connection in QTP?

Below example demonstrates how we can access the excel workbook as a Database using ADODB.Connection object.

Set objConnection = createobject("ADODB.CONNECTION")
'Set objRecordSet = createobject("ADODB.RECORDSET")
objConnection.Provider = "Microsoft.Jet.OLEDB.4.0"
objConnection.ConnectionString = "Data Source=C:\mybook1.xls;Extended Properties=Excel 8.0;"

'objConnection.Open "Data Source=excelDSN"
'We can also provide the Data Source in DSN style as mentioned above. excelDSN is the DSN I have created for the excel workbook using ODBC

'Open the database connection
objConnection.Open



'Execute sql query using connection object
'Please note how we have written the query to get data from sheet. "AA" is the name of the sheet.
'Note that you have to give the name of the sheet inside square brackets with $ as the last character.
'If you are having column names in your query you will have to put them inside square brackets as well.

 Set  objRecordSet = objConnection.Execute( "Select * from [AA$]")

 'recordcount property of the recordset object does not work in Excel So we have used EOF property to check the end of records.
Do While (not objRecordSet.EOF)

If  not  isnull(objRecordSet.Fields(8).Value) Then
print objRecordSet.Fields(8).Value
End If

'Move to next record in sheet - AA
objRecordSet.MoveNext

Loop

'Close the adodb connection
objConnection.Close

Advantages of using Excel as a Database.

  1. We can access one row at a time. So memory consumption is less
  2. Faster access to records.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Saturday, 18 January 2014

What are the challenges while automating the test cases in QTP?

Automation with QTP does involve lot of challenges. Based upon my experience I am stating some of the frequent challenges that may be faced by QTP engineers.

  1.  Automation of third party controls like infragistic controls in .net based applications.
  2. Automation of the PDF file comparison.
  3. Working with the controls inside tables.
  4. Selecting the drop down value will not trigger the onchange event in webpage.
  5. Automation of the web applications involving frames/iframes/framesets.
  6. All edit boxes having same properties..
  7. Elements like checkboxes, buttons, radiobuttons inside nested tables.
This is the list of most frequent challenges faced in automation projects. You can easily handle these challenges if you know how to access native properties of the objects.

QTP does provide the way to access native properties and methods using object property.
You can solve most of the issues in web application testing using html DOM in QTP. Please try to avoid index to identify any object as this will make your script very weak.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

How to select specific webcheckbox in QTP?

Sometimes there are webpages having multiple check boxes. You have to select specific check box.

We can solve this problem by 3 ways as mentioned below in QTP.

  1. Using index property
  2. Using Description object
  3. Using HTML DOM

Selecting the web check box using index -


if Browser("myb").page("myp").webcheckbox("index:=2").getROProperty("checked") = false then
     Browser("myb").page("myp").webcheckbox("index:=2").click
end if
'Above code will select the third checkbox on the webpage.

Selecting the web check box using Description Programming -

Set DescObject = Description.create()
DescObject("micclass").value = "webcheckbox"

set col = Browser("myb").page("myp").childobjects(DescObject)
col(2).click

Selecting the web check box using HTML DOM -

set col = Browser("myb").page("myp").object.getElementsByTagName("input")

'Please note that above statement will give you all the elements on the webpage having input tag.
You can check the innerhtml property of each element to see if the given input element's type is a checkbox or not.

for i=0 to i<col.count
x = col(i).getAttribute("type")
if lcase(trim(x)) = "checkbox" then
col(i).checked = true
end if
next

'Above code will select the first checkbox on the web page in QTP.

We can use same concept to select the specific check box in other environments like Java, .Net etc.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Friday, 17 January 2014

What are the different software testing metrics in automation projects?

Testing Metrics are used to measure the quality of the software product. In automation testing projects involving tools like QTP, Selenium, Rational Robot etc, We can have below kinds of metrics.

We can categorize the metrics in below parts.

  1. Test Progress
  2. Test Coverage
  3. Test Quality

Automation Metrics to measure the progress of automation.


  1. Test Cases Automated per Day.
  2. Test Cases Executed per Day.
  3. Test Cases Failure Rate.
  4. Test Cases Pass Rate.
  5. Average Execution time per test case.
  6. Total execution time required to execute all test cases.

Automation Metrics to measure the Coverage.

  1. % of test Cases that can be automated from all test cases.
  2. % of total test cases automated till now from all test cases that can be automated(Progress).
  3. Requirements/Test Cases Coverage.

Automation Metrics to measure the quality of product.

  1. Test Effectiveness - How many good defects uncovered by automation.
  2. No of Defects  Found by Automation.
  3. ROI
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Thursday, 16 January 2014

How to calculate return on investment (ROI) for automation projects?

Usually we automate the applications to get the benefits like cost saving, faster regression testing, overnight execution, accurate testing etc.

But automating the application also involves some upfront cost involved in it. We need to buy the automation tool like QTP, we need to train people on the tool then design the automation framework.

To measure the benefit of the automation projects, we need to calculate the return on the investments. We measure what all benefits we have got after automation of the project.

Effort Saved = Manual Efforts Required for Execution  - Efforts required for automated Execution.

Once we calculate effort saved for the entire testing cycle of the project, we can find ROI by below formula.

ROI = Total Effort Saved for all regression cycles - (A+B+C+D)

where

A = Total effort required for designing automation framework
B = Effort required for the maintenance of the automation scripts
C = Effort required for the automation of testing 
D = Licensing Cost of the tool

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

How to trigger the web element events like click, mouseover, mousedown in QTP?

As  the web applications are growing rapidly, the complexity is also increasing. Web toolkits, Ajax frameworks are being introduced to design web applications. This is making automation of such applications bit complex.

sometimes the automated steps of QTP does not trigger the events. Thus the javascript behind the web page does not get called.

In such scenarios we can use fireevent methods or we can also use HTML DOM to automate some part of the application.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

How to do automation estimations in QTP Projects?

Estimating the efforts required to automate the given application is very important steps in any automation project involving QTP or any other testing tool.

Below is the list of important factors to look at while estimating the automation project.

  1. Skill sets of the employees.
  2. Tool Support.
  3. Application Size.
  4. Test Scenarios to be automated.
  5. Complexity of the test cases to be automated.
  6. Scope of the automation (Features to be tested/ not be tested)
  7. Number of automation testers available.
  8. Framework availability in the organization.
  9. Productivity of automation testers in similar testing projects.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Explain Loadfunctionlibrary in QTP.

Loadfunctionlibrary is used to associate new library files in QTP.
The advantage of this function is that we can attach multiple files to script in single line.

Example -
loadfunctionlibrary "c:\abc.vbs","c:\xyz.vbs"


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

How to create constructor in class in vbscript/QTP?

QTP does support object oriented programming to some extent.

We can create constructors and destructors in vbscript classes using class_initialize and class_terminate methods.

class_initialize method acts like constructor function which gets called automatically when we create an object of the class.

Example - 

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Explain Err.Number in QTP

Err object is very important in QTP. We can handle errors using this object. Whenever you think that error might occur, you can check if the error really occured or not using err.number

Example -

on error resume next
a = 2/0
'Above statement contains error - divide by zero.

if err.number <> 0 then
print "Error number is " & err.number & err.description
end if

Remember that you can use on error resume next anywhere and any number of times in the code.

To stop suppressing errors in QTP code you can use below statement.

On error goto 0
After this statement, if any error occurs, script will prompt you with the error message.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

On Error Resume Next in QTP

Usually in keyword driven frameworks, we call the functions to perform specific operation like createOrder(), CancelOrder(). If error occurs in any of these functions, it is not important that we come back to main driver script and continue with next test case.

Code structure below demonstrates how we can do this in QTP.

'Code inside driver script.
On error resume next
'The advantage of the on error resume next is that we can continue to next statement if any error occurs in current statement.
Call createOrder()
If err.number <> 0 then
print err.description & err.source
End if
'*************************************************
'If error occurs at statement2, control of the script goes back to the caller. It does not execute any statment after statement2. This saves lot of time .

Function createOrder()
statement1......
statement2......
..........
more statements

End Function
**************************************************************************
Please note that if error occurs, control goes to next line of code and not the next block of code.
Example 1 -
on error resume next
a = 3/0
msgbox "hello"
msgbox "end"
'****************************************************************

Example 2 -
Consider below piece of code.
on error resume next
if (2/0) = 2 then
msgbox "true"
else
msgbox "false"
msgbox "end of code"
'************************************************************
Example 3 -
Consider below piece of code.
on error resume next
call myproc()
msgbox "end"
-------------------------------------------------------------------------------------
sub myproc()
if (2/0) = 2 then
msgbox "true"
else
msgbox "false"
end sub


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

How to access the excel as a database using adodb.connection in QTP?


We can work with excel in 3 ways in QTP as mentioned below.

  1. Using Excel.Application
  2. Using Adodb.Connection
  3. Using DataTable

To know how we can use Excel.Application to read or write the excel files, you can refer these links.

To know how to use datatable to load excel into it, use these links.

In this article we will see how we can read or write excel files using Adodb.Connection object.
Excel workbook is considered as a database. Each sheet in the excel workbook is considered as a table.
First row in the sheet is considered as column header and all other rows are considered to be records.

Here is the sample code to connect to excel database.

Set excelConnection = createobject("Adodb.Connection")
excelConnection.open "Data Source=c:\abc.xlsx;Provider=Microsoft.Jet.OLEDB.4.0"
Set rs = excelConnection.execute "Select * from [sheet1$]"
For i=0 to rs.recordCount-1
For j=0 to rs.fields.count-1
print rs.fields(j).name & rs.fields(j).value
Next
Next

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

How to click on the links or buttons in webtable in QTP?

Consider below web table. It has got 4 rows. Now what we have to do is – we have to click on the edit or delete link in front of the given employee.


Employee Name Operation  
Sagar                Edit  / Delete  
Amol                Edit  / Delete  
ajit                        Edit  / Delete


If we try to save links in OR, QTP uses the index property to identify the edit or delete buttons. But using index is not reliable because if new employee is added in the middle index of the existing links will also change.

To handle such situations, we can use html dom. We can solve the problem using below approach.
1. First get the row number in which given employee exists.
2. Then find the links in that row using getElementsByTagName method.
Here is the code to find the row number for the given employee.

function getRow(byval Employee)
Set tableObject = Browser(“MyB”).Page(“Myp”).WebTable("Mytable")
For i=1 to tableObject.object.rows.count
if tableObject.getCellData(i,1) = Employee Then
print "row found " & i
getRow = i
exit function
end if
Next
getRow = -1
End function

Above function will get the rownumber for the given employee. After this we can get the links in front of the given employee using below code.

Set tableObject = Browser(“MyB”).Page(“Myp”).WebTable("Mytable")
Set rowElement = tableObject.object.getElementsByTagName("tr")(rowNumber+1)
set links = rowElement.getElementsByTagName("A")
'Above statement will return all the links inside given row.
if links(0).innerText = "Edit" then
links(0).click()
End If

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Thursday, 9 January 2014

SQL - QTP Interview Questions and Answers

Hello friends,
In this article I am going to discuss some questions based on sql queries. We will see some queries that are frequently asked in QTP Interviews.

1. SQL Query to find the second highest salary of the employee

This query is very popular among interviewers. Answer is also very simple
select max(salary) from emp where salary not in (select max(salary) from emp)

As you can see, we have used nested query to get the second highest salary of the employee. But above query can not be generalised to find the nth max salary.
Below code will solve the issue easily.
Select min(salary) from (select top 2 distinct salary from emp order by salary desc)  

Above query will get the second highest salary. To get the nth highest salary, you have to just replace 2 by n.
So the query to get the 4th highest salary will be 
Select min(salary) from (select top 4 distinct salary from emp order by salary desc)  

Please note that above query works in sql server and microsoft access but not in other databases like oracle or mysql.

2. SQL Query to find the duplicate values from the column.

Sometimes we need to find the duplicate values from the given column.
select city, count(city) from table group by city having count(city) > 1
Above query will print all cities that have appeared more than twice in the column city.

3. SQL Query to find the employees whose names start with s.

select * from emp where name like 's%'

To get the employees whose names start with s, a or b

select * from emp where name like '[sab]%'

4. SQL Query to copy records from one table to another.

select * into newtable from emp
Above query will copy all records from emp table to newtable.

To insert records in the existing table, you can use below queries.

insert into table1
select * from table2

insert into table1(name, city)
select name, city from table2.

5. How to execute the stored procedure in QTP?


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.