开发者

how to clone browser instance in watin

开发者 https://www.devze.com 2023-04-10 23:11 出处:网络
I need to clone the browser instance, In watin IE is shared resource which makes very difficult to store the previous browser instance

I need to clone the browser instance, In watin IE is shared resource which makes very difficult to store the previous browser instance

var browser = new IE(http://www.stackoverflow.com);

var copybrowser = browser;

browser.goto("http://www.superuser.com");

console.WriteLine(browser.Uri);
console.WriteLine(copybrowser.Uri);

output:
http://www.superuser.com
http://www.superuser.com

In this case i need to store the previous instance, i have seen clone method in watin, but i was unable to recall, does any one how to solve this problem, i ne开发者_StackOverflowed to get the previous instance of browser


Just create a class with browser property

public class Session
{
    public Browser browser { get; set; }
    ...
    ...
}

In this case you can create multiple Session instances when each instance has his own browser instance.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号