How to handle a popup whose ID value in the url changes every time the popup appears

I am working with WatiN tool. I have a script where I need to check a checkbox and click OK on the popup. i used AttachtoIE method and used url attribute to attach to popup. Now the problem is that the url contains an ID attribute and its value changes every time the popup appears. How can I handle this or is there any other method other than AttachtoIE? please give some tips.

Thanks.

0


a source to share


1 answer


You can use Find.ByUrl (neww regex ("some regex expression")) to ignore the id part. Or, if you are sure that there is only one IE instance open before the popup opens, attach it to an IE instance that does not have the same URL as the browser from which you opened the popup.



NTN, Jeroen

+2


a source







All Articles