1. Optional Step in QTP
As we know, lot of times we need to check the existence of the object before continuing to the actual operation on that object. Here is nice option which will reduce these kind of If(obj.Exist) lines like,
Drawback:
This OptionalStep can be used only with full test object descriptions like above statement.
As we know, lot of times we need to check the existence of the object before continuing to the actual operation on that object. Here is nice option which will reduce these kind of If(obj.Exist) lines like,
- OptionalStep.Browser("Mercury Tours").Page("Find Flights").WebList("depart").Select "Paris"
Drawback:
This OptionalStep can be used only with full test object descriptions like above statement.
- 'This will not work
- Dim objPage
- Set objPage = Browser("Mercury Tours").Page("Find Flights")
- OptionalStep.objPage.WebList("depart").Select "Paris"
- 'and You can't use inside with statement
- With Browser("Mercury Tours").Page("Find Flights")
- .WebList("depart").Select "Paris"
- End With
- 'If you want to use inside with you should give like,
- With Browser("Mercury Tours").Page("Find Flights")
- .WebList("depart").Select "Paris"
- OptionalStep.Browser("Mercury Tours").Page("Find Flights").WebEdit("name").Set "abcd"
- End With
Nice information thank you,if you want more information please visit our link selenium online training
ReplyDelete