Casting repository items
Posted: Sun Mar 18, 2012 2:39 am
Hello,
I have correctly tracked a WebDocument in the repository.
However if I try to change its type to WebDocument in its properties, it won't let me do so. I can see the WebDocument option in "adapter type", but once I click on it, it reverses to default. Why cannot I set its type?
Another question - how do I get a browser from that WebDocument programatically from code?
If I drop it from repository, I get code similar to the following:
But I need it to be of WebDocument type in order to be able to do the following:
Ranorex won't let me call .BrowserName, because myWebPage isn't of type WebDocument.
If I try to cast it the following way I will get a error:
I have correctly tracked a WebDocument in the repository.
However if I try to change its type to WebDocument in its properties, it won't let me do so. I can see the WebDocument option in "adapter type", but once I click on it, it reverses to default. Why cannot I set its type?
Another question - how do I get a browser from that WebDocument programatically from code?
If I drop it from repository, I get code similar to the following:
Code: Select all
var myWebPage = repo...;
Code: Select all
if(myWebPage.BrowserName == "IE") ...
If I try to cast it the following way I will get a error:
Code: Select all
WebDocument myWebPage = (WebDocument)repo...;/code]
How can I get browser from a WebDocument that's stored in a repository?
Thanks!