SQA QTP tutorial – WebList identified as a web element and how to select an item from this list

Hi. Today, I wanted to touch base on unorthodox objects that may appear as other objects. In my application, the web list appear as web elements and I wanted to show you a solution for selecting an item in this type of web list. In this situation, just treat it as a regular web element and you can directly click on this element to select it. Browser("index:=0").Page("title:=.*").WebElement("outertext:=UniquePropertyName, "Index:=0").Click The above code is just an example of how you can select an item out of this type of object. 1. Click on the web list so that the list opens up, use the object spy to identify the item in the list you are trying to select. 2. Then replace the identification properties in the example code above. 3. I am using index in this example because with one unique identifier, you may have trouble selecting the object. If this is the case, try switching from index 0 and 1 and you shouldn't have any problems. That's it! As easy as that! Post your comments and questions...

Automation QTP tutorial-double clicking on any object

Hey guys. Todays tutorial is quick. If you want to double click on any object, just identify your current browser, page, and object you want to click on. But instead of the regular click method to click on it, we will user FireEvent("ondblclick"). Browser("Index:=0").Page("title:=.*").WebElement("innertext:=unique property name").FireEvent "ondblclick" The Index of the Browser is dependent on how many browser windows you have open, and in which order the windows were opened. So if you have 2 browser windows open and you want to click on the first window, set the browser index=0. If you want to click on the second window, set the index=1. Easy right? The page title is using the .* regular expression which just means that the a specific page title is not needed. Find the generic page that is associate with the browser window. the "unique property name" for the web element can be anything. So if you have a web element with a unique property such as "WebElement1" then the code above would look like WebElement("innertext:=WebElement1") Lastly, as explained above, just use the FireEvent "ondblclick" to double click on this object. You can replicate this code for any object that you would like to click on. Post your comments and questions below! We love your...

Software Automation QTP tutorial – 5 top reasons for using automation

Hi. If you work at a company that's not using automation yet, you are well behind the industry. Automation is still a relatively new concept in the industry, but is becoming an important part of every testing environment moving forward. Today, I am going to cover the top 5 reasons for including automation in your companies testing environment. 1. Repetitive Tasks: If you've ever been a manual tester, you know exactly how tedious and repetitive testing tasks can get. Most manual testers end up testing the same application functionality multiple times. This is not only time consuming, but takes away from other testing tasks. This is where automation comes in. With automation, a simple and quick script can take care of these repetitive tasks. At the click of a button, we can test the repetitive task behind the scenes, while manual testers can move forward with testing other functionality. 2. Accuracy: Manual efforts are not always consistently accurate. It's not a surprise that human beings make mistakes. The great thing about automation, is once you have the script and data in place, automation accurately repeats the same testing procedures whether you run the test once or a hundred times. 3. Automation helps developers: How many times has a developer claimed that they've completed a portion of the application, only to find out that it doesn't work after deployment? Although developers create unit tests, these tests do not perform actual GUI testing tasks that are needed for the authentic user experience. After a developer deploys their code, running automation tests can verify whether their code has broken the build or not....

QA Automation: QTP tutorial – using the same script for multiple environments

Hi. Today, I will show you an awesome tutorial for using the same script to test multiple environments. Let's say you're working on an application that requires automation tests to run on two environments. The first environment is the test environment before deployment to production. And the second environment is the actual production environment after deployment. Let's also say that the functionality for both environments is exactly the same, but the login username and password differs based on the environment. In this scenario, you don't need to create two separate scripts to accommodate the differences in login credentials. You can create one script and just change the login credentials based on the environment. I will be using our premade framework to write the main script. This is a framework I haven't shared on our website so you will have to write your own code from scratch. I just want you to use this tutorial as an example. Let's get started! 1. Open UFT and create a new test. We will create the login functionality for our qtptutorial.net website. Some automation testers may create two separate scripts for these two environments which may look something like this: 'Test Environment Open_URL "http://www.qtptutorial.net/wp-login.php?loggedout=true" Set_TextField_ByHtmlid "user_login", 0, "TestEnvironment" Set_TextField_ByHtmlid "user_pass", 0, "123456" Click_Button "Log In", 0 'Prod Environment Open_URL "http://www.qtptutorial.net/wp-login.php?loggedout=true" Set_TextField_ByHtmlid "user_login", 0, "ProdEnvironemnt" Set_TextField_ByHtmlid "user_pass", 0, "678900" Click_Button "Log In", 0 Notice how these two scripts are exactly the same except for the login credentials depeneding on the type of enevironment. We will consolidate this into one script which will save us a lot of time now and in future maintenance. 2. I will create two global variables. One for the username and one for the password. Click file -->New-->Function Library and name the Library...

Automation: QTP tutorial – Function to add a new directory folder

Hi. Today, we have a simple and easy to use function to add a folder to a specific directory. Call the function like in the example below: 1. For the first argument, enter a folder path where you want to create a directory 2. For the second argument, enter the folder name 3. Run the script and you should see the "NewTestFolder" in your C directory       Call function: funAddNewFolder "C:/", "NewTestFolder" Function code: Function funAddNewFolder(path, folderName) Dim  f, fc, nf Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(path) Set fc = f.SubFolders fc.Add(folderName) set fso=nothing End Function   Please leave comments and questions...

Pin It on Pinterest

Clef two-factor authentication