1

私はqtpを初めて使用します。これは、「URLが間違っている可能性があります」などのいくつかのエラーに直面しているサンプルスクリプトです。

Browser ("Google").Navigate ( "http://www.google.com")
Browser ("Google"). Page ("Google").Sync
Browser ("Google"). Page("Google").  WebEdit("q:"). Set (" tarun lalwani")
Browser ("Google") .Page  ("Google"). WebButton ("Google Search").Click
Browser ("Google") .Page (" tarun lalwani - Google").link ("knowledgeInbox").Click
Browser ("Google").Page ("knowledgeInbox").Sync
Browser ("Google") .close 

何が問題になっていますか?

4

4 に答える 4

2

タルンのウェブサイトから例をとったことがわかります。いくつかの質問/ポインタ:

  1. これはサンプルスクリプトのすべてのコードですか?

  2. このサンプルスクリプトに付属していると思われるオブジェクトリポジトリはありますか?

  3. これらのランダムなスペースはすべて、実際のQTPコードに存在しますか?

  4. どのような正確なエラーメッセージが表示されますか?「URLが間違っているかもしれない」というのは、おそらくあなたが実際に得ているものではないと思います...

于 2009-08-18T13:51:41.513 に答える
1
  1. オブジェクトをオブジェクトリポジトリに保存したかどうかを確認します

  2. 下記のコードを試してください

    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "http://www.google.co.in"
    IE.Visible = True
    IE.Document.All.Item("q").Value = "serach"
    IE.Document.All.Item("f").submit()
    
  3. コードにはスペースを入れないでください。たとえば、スクリプトは

    Browser ("Google") .Page  ("Google"). WebButton ("Google Search").Click
    

    そのはず

    Browser("Google").Page("Google").WebButton("Google Search").Click
    
于 2009-10-07T11:22:23.827 に答える
1

ブラウザを指定する必要があります。

browser("IE").Page("website name").etc.......

または、変数に格納します。

set a=browser("IE").page("name of ur site etc")
a.webedit("name of text field").set "pavan"
a.webbutton("search").click

スクリプトを実行する前にローカルリポジトリを作成することもできます。

于 2011-01-01T07:36:08.917 に答える
1
SystemUtil.Run "iexplore","URL of the application"
With Browser("A").Page("B")
    .WebEdit("Logical Name of the Text Field").Set"SearchKeyText"
    .WebButton("Text label of the Button").Click
End With
于 2012-07-12T07:01:47.570 に答える