01-07-2012, 10:49 AM
Assuming that there are few inputs and for the logic mentioned ...you may refer the below code
you can go for what Akankhya said...but it would cause an issue if the page displayed is not as expected for a particular input.
Say for input 1, we expect "Pavani-1" page....but the page actually displayed could be an error page in which case we get error page title when we use Browser("name:=").Webpage("title:=.*").getROProperty("title").
Code:
Option Explicit
strInput=inputbox( "Ener a value")
Select Case strInput
Case 1:
Set oPage=Description.Create
oPage("title").value="Pavani-1"
Case 2:
Set oPage=Description.Create
oPage("title").value="Anu-2"
Case Else
Set oPage=Description.Create
oPage("title").value="something"
End Select
'perform required operations on the page
'at the end
Set oPage=Nothing
you can go for what Akankhya said...but it would cause an issue if the page displayed is not as expected for a particular input.
Say for input 1, we expect "Pavani-1" page....but the page actually displayed could be an error page in which case we get error page title when we use Browser("name:=").Webpage("title:=.*").getROProperty("title").