Qtp problem summary

Source: Internet
Author: User

Q:RunactionCan the variable be followed (the action is called dynamically, so the action name is obtained from the database, but the call can never be found )? 

A: The script contains runaction "testbase [case1]" And oneiteration. Place the content in the quotation marks in row 22nd of the global table, and modify the code:

Datatable. getsheet ("Global ")

Datatable. setcurrentrow (22)

Strlogin = datatable ("actionname", "Global ")

Runaction strlogin, oneiteration

Help
There are also related help, such:

Runaction actionname, [iterationmode, iterationrange, parameters]

Actionname: String: the name of the action

 

Q:Qtp8.2(Using VBScript to write some common functions required by the test script, is there a way to use include
You do not need to copy these functions to the new script every time )?

A: Executefile "... \ project \ devariable. vbs" is added at the beginning of the program"

 

Q:QtpHow to perform regression testing (more than 300 test cases, can TD be managed )?

A: TD can be implemented and a test set can be generated. A test set can contain several test scripts. Qtp8.2 provides the test batch runner tool, but there is no report after running. HP has another tool called MTM.
(Multi test Manager
).

 

Q:In qtp, how to set other browsers (XP system, when using IE to access the program, every time the system always prompts to block the installation of ActiveX plug-in, you need to manually install. But this process is recorded to qtp
The playback is successful. When I parameterize a large amount of data for an input box, some will fail during playback.

A: 1. Set the delay time for each action. The delay can be wait x (in seconds)

2
, Set to use another browser (the error message is object not visible), install the plug-in to add a new browser

Systemutil. Run "file" "Params" "dir" "op'' "Mode"-qtp
Methods and parameters for running executable files

P.s.: We recommend that you use the IE browser or the IE kernel browser for testing.

 

Q:CheckpointCheck whether the webpage can be implemented. If the webpage is garbled, an error report is returned?

A: Text not displayed can solve the problem.

Summary of text checkpoint.

1. Text Checkpoint Check is divided into three parts. Checked text
, Text before, text after. By default, checked text performs the exact check, while the other two perform the fuzzy check. Text before (after) can check less content than the actual content. But it cannot be different from the actual content. Otherwise, it will fail.

2. Exact match option. If this option is selected, all three parts perform the exact check. I personally think it is no different from checking only the checked text part.

3. Text not displayed. This option is essentially a process of result inversion. The result of the check is reversed, and the pass is changed to fail, and the fail is changed to pass.

 

Q:How can I record the page verification code? (Can the output value obtain the web page verification code? Generally, the verification code is generated immediately from the image. How can I use the qtp script to obtain the verification code before login and enter it in the verification code column)

A: (1) a very simple method: during testing, it is called to develop the function to block the verification code, and then record the script. The verification code function can be easily tested manually.

(2) the only way to get the image verification code is to get a program with the programmer and write fucntion in the script! Manual input is required.

 

Q:How to call a function, process (or variable or constant) defined in another action)

For example:

-----------------------------------

'Action _

Public strurl

............

Function querylist ()

............

............

End Function

------------------------------------

'Action _ B

'How to call the querylist function and strurl

A: (1) You can share these variables and functions in a vbs file as a resource file, and add the file to each action. If the Function
When a control is called, make sure that the control exists in the object repository of the corresponding action.

(2)
Define a unique function in a callable action.

 

Q:How to manage the source code of qtp? (Qtp generates a lot of source code and is related to environment controls. How can I manage the source code if multiple developers are required ?)

AOne is code. You can use VSS and CVS
And so on. One is through TD or QC case-based code management. In fact, the first method is based on version control, and the second method is based on case management. Different management methods vary. However, team collaboration requires clear division of labor and progress control. You can use the development method for code management.

 

Q:The script cannot be played back. Is there a problem with ActiveX settings in IE?

A: Click Tools ---> options... ----> active screen, click the advanced... button, and select load ActiveX Controls (
That is, the opposite sign is displayed.) At the same time, you can change the run scripts option to disabled.

 

Q:QtpCannot record some controls?

A: 1. Adding the corresponding add-in is the first option to solve this problem, if there is a corresponding add-in. For example, if you are testing a Java program, you need to load Java add-in. You have installed qtp
Three add-in (ActiveX, Visual Basic, and Web) are loaded. In addition, qtp 8.2 can also load the add-in
Quick test professional Java 6.5 add-in
, Quicktest professional Oracle 6.5 add-in, quicktest inclusiona Siebel 8.0
Add-in and quicktest professional terminal emulator 8.0 add-in. (The add-inner that can be loaded by qtp for each layout can be in the corresponding qtp_install_guide.pdf
And main_users_guide.pdf .)

2. Set unrecognized objects to virtual objects ). Click "Tools" ---> "virtual objects" ---> "new virtual object..." In qtp, and the virtual object wizard will appear.
Dialog box, according to the wizard of wizard, you can set some unsupported controls to virtual controls and add them to the object library.

3. manually add objects that cannot be recorded by qtp to object repository.

4. Special Solutions. If the unrecognized control is made of VC, you can write a dynamic link library and then let qtp call it.

 

Q: exit the test.

Exitaction-exit the current operation regardless of its loop attribute.
Exitactioniteration-the current cycle of the exit operation.
Exitrun-exit the test regardless of its loop attributes.
Exitglobaliteration-exit the current global loop.

 

Q: How to Disable IE?

Code1:

Dim winie, ie, K, M
Set winie = descr restart ption. Create ()
Winie ("micclass"). value = "Browser" 'The regexpwndtitle attribute values of all pages are "Microsoft Internet Explorer". You can also useOthersAttribute

Set Ie = desktop. childobjects (winie)
M = ie. Count
If M> 1 then
For k = 0 m-1
IE (k). Close '0 is the last one to open. You can close the opened items and change the cycle to for I = 1 to M.
Next
End if
Set Ie = nothing

Code2:

Systemutil. closeprocessbyname "iexplore.exe"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.