QTP

Dynamic array in vbscript gets cleared when control comes out of loop

天涯浪子 提交于 2019-12-24 07:47:20
问题 I am newbie to VBScript. I am trying my hands at Dynamic array concept in VBScript below is my code. Code: dim arr() For i = 0 To 3 Redim arr(i+1,2) arr(i,0)=i arr(i,1)=i+1 MsgBox arr(i,0)&"-"&arr(i,1) Next For i = 0 To UBound(arr) MsgBox arr(i,0)&" "&arr(i,1) Next As soon as the control comes into second loop all the values stored in arr are lost. i do not understand why and how? I've tried adding Preserve keyword but it throws subscript out of range error. TIA!!! 回答1: [oops, missed the two

QTP - testing while browser/page title changes

喜你入骨 提交于 2019-12-24 03:19:12
问题 I am trying to make simple testing but failed because I have no clue how to handle with browser title that changes during the testing. Simple example: Google>Find "blabol" Once its done, the browser title in QTP changes its name to "Google - results....". This is obviously problem when the search text is a variable that changes between iterations because the browser text is hardcoded. I would need something like "this browser" and "this page", if you get what I mean. Thanks 回答1: In a couple

QTP UFT Unable to find row count from table

◇◆丶佛笑我妖孽 提交于 2019-12-24 01:24:05
问题 I was not able to find row count of that table and when I spy, Object Respository doesn't show any webtable. Can you please help me on how to find the row count. It was developed in Angular Js framewrok. Attached Object Repsoitory: The DOM 回答1: The elements in the screenshot do not contain a TABLE element (only DIV s). Try running (in the browser's developer tools) document.getElementsByTagName('table') if it returns an empty set then this is the reason UFT isn't showing you a table. UFT does

ArrayList with Arrays

三世轮回 提交于 2019-12-24 00:48:02
问题 It seems that more "complex" ArrayLists are not widely used, since I'm unable to find any concrete, helpful info about it. I'm trying to create an ArrayList of Arrays (and eventually an ArrayList of ArrayLists of Arrays), but I seem unable to either add Arrays to the ArrayList, or access the Array's elements. All this is done using VBScript in QTP. (The code reads from an Excel file, which is working fine.) Set my_sheet = ExcelObject.sheets.item(testCaseSheet) testCase = CreateObject("System

How do I use WScript.Shell SendKeys to send Number Pad key strokes?

冷暖自知 提交于 2019-12-23 15:48:31
问题 I am trying to use WScript.Shell SendKeys method to emulate sending a key press from the Number Pad. I have an application that I am writing automated testing for using QTP. It is a Web Browser based application and the input is into a Java App within the web page. The input only accepts key presses from the Number Pad and the Enter key. So far I am using this code: Dim strInputKey strInputKey = "{ENTER}" Set objWsh = CreateObject("WScript.Shell") Browser("Launch Browser").Page("Test

VB Script: how to find whether a DIV tag contains specified text

假装没事ソ 提交于 2019-12-23 03:14:36
问题 myaddress= "Sk ks, Röntenstrasse 31, Wolle" I am writing VB script in QTP. how can I find out whether if any DIV tag contains this "myaddress"? if it exists msgbox "it exists" if not msgbox "it doesn't". Thanks in advance. 回答1: Using QTP you can use the innertext property to find an element. If Browser("bb").Page("pp").WebElement("html tag:=div", "innertext:=" & myaddress).Exist ' Treat element End If BTW, if myaddress is just part of the inner text you should anchor it with wild cards on

QTP to Jenkins integration help need CI

China☆狼群 提交于 2019-12-22 18:37:39
问题 We have to run QTP VB Scripts from Jenkins being as a part of CI Can any one suggest me what is the best way to integrate ? Advanced thanks Thanks 回答1: Jenkins can run anything you can run from the command line, and you can create QTP Automation objects : Dim Application Set Application = CreateObject("QuickTest.Application") Application.Launch Application.Visible = True Application.Open "testfile", True Dim Test Set Test = Application.Test Test.Run If you search for quicktest.application you

How to fetch the content from the PDF into a string using QTP/VBScript?

非 Y 不嫁゛ 提交于 2019-12-22 16:40:59
问题 I need to validate a particular content from the PDF using QTP . How I can get the content from the PDF into the string Using QTP/VBScript. So that, I can validate the content in the PDF. 回答1: Do visit Here. You will get your answer, this is one of the menthod to work with PDF in QTP. You can also fetch data from PDF by passing Keys i,e, Ctrl+a then Ctrl+c then copy this data to Clipboard & use this data for comparing with your standard data Sample Function For Getting data from PDF, When PDF

How to Associate Function Libraries to QTP Script?

被刻印的时光 ゝ 提交于 2019-12-22 13:57:16
问题 How to Associate Function library with QTP script outsie the QTP environment. your help is highly appreciated. thanks 回答1: There are 4 Different Ways to Associate Function Libraries to your QTP Script. Please refer this Link 来源: https://stackoverflow.com/questions/11071302/how-to-associate-function-libraries-to-qtp-script

QTP Cannot Create ActiveX Object

天涯浪子 提交于 2019-12-22 11:15:39
问题 While working on script, I am facing this issue. I can't post the whole code but this is a sample that does the samething that I wrote myself; Dim qtpApp Set qtpApp = createObject("QuickTest.Application") qtpApp.Launch I have also tried this: Set qtpApp = createObject("QuickTest.application") And This: Set qtpApp = createObject("Quick Test.Application") But I Keep Getting "Active X Component cant create object. on Line x: "Set qtpApp = createObject("QuickTest.Application")" Any help