質問

私は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 

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

役に立ちましたか?

解決

TarunのWebサイトから例を挙げたことがわかります。いくつかの質問/ポインター:

  1. これは 全て サンプルスクリプトのコード?

  2. この例のスクリプトが付属していると予想されるオブジェクトリポジトリはありますか?

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

  4. ちょうど エラーメッセージが得られますか? 「URLが間違っているかもしれない」はおそらくあなたが本当に得ているものではないと思います...

他のヒント

  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
    

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

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

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

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
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top