質問
私は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サイトから例を挙げたことがわかります。いくつかの質問/ポインター:
これは 全て サンプルスクリプトのコード?
この例のスクリプトが付属していると予想されるオブジェクトリポジトリはありますか?
これらのランダムスペースはすべて、実際のQTPコードに存在していますか?
何 ちょうど エラーメッセージが得られますか? 「URLが間違っているかもしれない」はおそらくあなたが本当に得ているものではないと思います...
他のヒント
オブジェクトリポジトリにオブジェクトを保存したかどうかを確認してください
以下のコードを試してください
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()
コードにはスペースがありません。たとえば、スクリプトはです
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
所属していません StackOverflow