hp-uft

How do you simulate a keyboard enter event in UFT

纵然是瞬间 提交于 2019-12-04 15:01:07
I have a web application that I am testing with HP's UFT software. Within my application, there is a text field with an onkeydown attribute. When a key is pressed within the text field, a function is called which triggers different actions depending on what key was pressed. I am interested in the enter key. When the enter key is pressed, rows are created within the form. How can I simulate the enter key being pressed within the field? I have tried field1.Set Chr(13) field1.FireEvent "onkeydown" but it doesn't trigger the event. I am trying aviod using the SendKeys command. Motti If you use

How to Zoom in or Zoom out in a webpage while using UFT/QTP

▼魔方 西西 提交于 2019-12-03 20:33:53
I would like to control the zoom in and out feature of my webpage of the application under test using UFT. This is required as the zoom level changes dynamically and it becomes difficult to identify the objects. I have found a code but it is useful if you need to change the zoom level at one instance or at the start. below is the code Function ChangeIEZoom Dim intZoomLevel, objIE intZoomLevel = 110 Const OLECMDID_OPTICAL_ZOOM = 63 Const OLECMDEXECOPT_DONTPROMPTUSER = 2 Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible = True objIE.Navigate ("www.google.com") While objIE

How does QTP wait till the page loads dynamic data?

◇◆丶佛笑我妖孽 提交于 2019-12-03 16:01:54
I have a scenario where the browzer status =done but still the page is not loaded. Is there a common procedure where the qtp can wait till the page is fully loaded? I tried with objBrowzer.sync,objPage.Sync,objPage.waitproperty "readyState","completed",50. But it does not work always. I cannot even but a wait statement so that it waits till that object appears.because in different cases different objects are present. Is there any common statement that would work in all scenarios? Thanks in advance. You just discovered that QTP does not offer any explicit support for synchronizing with

clicking on particular link using qtp function

丶灬走出姿态 提交于 2019-12-02 20:23:05
问题 I want to automate login process to flipkart by creating a function which is being called in an action Function Website() 'this is the function Systemutil.Run("iexplore.exe"), "http://www.flipkart.com" End Function Website( ) 'this is where the function is called in the action The browser is opening but I don't know how to click on login without doing a record and run , but only through code and the function. Please help me. 回答1: If you want to do it with descriptive programming, this would

clicking on particular link using qtp function

做~自己de王妃 提交于 2019-12-02 13:25:27
I want to automate login process to flipkart by creating a function which is being called in an action Function Website() 'this is the function Systemutil.Run("iexplore.exe"), "http://www.flipkart.com" End Function Website( ) 'this is where the function is called in the action The browser is opening but I don't know how to click on login without doing a record and run , but only through code and the function. Please help me. If you want to do it with descriptive programming, this would be a simple example: (I used the direct login-page, because it is easier than clicking on that login link)

QTP/UFT - Close all browsers except QC/ALM

点点圈 提交于 2019-12-02 07:05:58
Currently I am using the below code to close all the browsers except the ALM browser from where I run the test suite from. However When I run the suite from ALM, the below code identifies 2 browsers - ALM browser and the test case browser. It first closes the test case browser and when it executes the iteration for the ALM browser, it says the browser is not identified when it tries to find the name of the browser. I am not sure why it counts it as a browser if it cant identify it later. Any thoughts on how to resolve this? Dim oBrDes Dim oBrObjList Dim objIndex Set oBrDes=Description.Create

Insert node in xml document using c#

允我心安 提交于 2019-12-02 06:43:44
问题 I was trying to insert an XML node in XML document at a specific position. This is my xml: <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Body> <readContract xmlns="http://implementation.company.schema.reference"> <ContactNumbers>10158</ContactNumbers> <productGroups>0085</productGroups> <indicationBalanceInfo>false</indicationBalanceInfo> <indicationBlocked>true</indicationBlocked> </readContract> </Body> </Envelope> And am trying to insert another tag <productGroups>0093<

How to import data file for UFT API testing?

半腔热情 提交于 2019-12-02 05:18:39
I am working on a project which requires to dynamically import the test data on run time and run the API test corresponding to the test data. I tried using XMLload which I directly load from the xml request. This seems to be working fine. But like GUI testing, where we import the test data, I want the same for API testing - where I can import a excel from an external source dynamically and give the values to the request. How can I do this? As far as I understand your question, you want to load test data from Excel file. And that is what I have done in my previous project but little differently

Retrieve only numbers and ignore alphabets from String

旧城冷巷雨未停 提交于 2019-12-02 00:36:58
I have strings like 10A or 20B. I want 10 in 10A or 20 in 20B. How to split only numbers from string using VBScript or QTP internal commands? I would use a regular expression: s = "20B" Set re = New RegExp re.Pattern = "^\d+" For Each m In re.Execute(s) num = CInt(m) Next WScript.Echo num 来源: https://stackoverflow.com/questions/39601885/retrieve-only-numbers-and-ignore-alphabets-from-string

Get dates from AUT?

◇◆丶佛笑我妖孽 提交于 2019-12-01 12:41:33
My Web-based application (like most) follows the browser locale to format dates. So if you configure British English as the preferred language in the browser, the app will display dates in " DD/MM/YYYY " format. Now QTP (ok, it´s VBScript that is the culprit) does not know about this. It strictly follows the local machine´s locale settings. Unfortunately, that means that if my local machine is configured to German locale, and the app is in English (because the browser is configured this way), VBScript´s DateValue function will fail (because it expects " DD.MM.YYYY " format. So what is an