I have this case as:
- Select country that has states, the State drop down is displayed
- Select country that does not have any states, the State drop down is not displayed.
i use the command to check as: rc = Browser("OSS").Page("ManageCustomer").Frame("CustomerDetail").WebList("ddlState").GetROProperty ("disabled").
But the return value of rc is always '0'.
I tried get visible property but the return value is always 'True'.
So i want to ask is there any way to check this case?
Thanks for your answer,
I have the same with the message, it is a WebElement. When click OK button on the message, it's dismissed but QTP still can get all the property of it with the same value when the message is displayed. So i can not find the way to check it dismissed or not.
Hi,
You will have to use GetROProperty("items count") on State weblist everytime you change the country. If there are options available in state weblist, items count will be greater than 1 and if there are no states, it will be 0.
The message is the image, and the properties of it are: innertext, outertext, visible, ...
I tried check the property 'Visible', but it is always True during the message is displayed or not.
Thanks,
linhke
Typically these types of dialog boxes are WebElements using DIV tags. Also, they typically are not actually hidden when not shown, which is why the visible and exist always return true. The trick is that their dimensions are set to 0. If you are able to identify the DIV that represents the dialog box (which it sounds like you have done), you can test the width and height of the WebElement to determine if it is visible or not. Something like:
Code:
If Browser("").Page("").WebElement("").GetROProperty("width") > 0 _
And Browser("").Page("").WebElement("").GetROProperty("height") > 0 Then
MsgBox "Dialog is visible!"
End If
I use Firebug (with Firefox) to inspect the HTML of the pages I'm testing to determine the DIV structures in situations like this. It's as easy as right-clicking and selecting "Inspect Element." Firebug has really been a great help to me when trying to figure out issues like these. IE has the Developer Toolbar that has similar functionality, but is not as nice. Check them out!