Posts

Showing posts with the label ChildObjects

Working with WebRadioGroup

QTP WebRadioGroup means a radio button on the web page. Identifying and working with them can be easy or difficult. Sometimes they works out fine and at times executing the same code gives you error. If you have two radio buttons on the screen for example Gender selection options the code below might give problem. Browser("").Page("").WebRadioGroup("").Select "M" Where "M" can be the id or the value of the radio button (Spy the object). So what is the problem in the code above? As there are two radio buttons QTP identifies them as same, so we need to differentiate between them. Index is a property by which you can differentiate, it tells the position of the object. So if we write the same code below with an additional index property it will work fine. Browser("").Page("").WebRadioGroup("html id:=" ,"index:= 1").Select "M". This code is intended to select a radio button among two, what ...