I am using WatIn to login to web ,i am working with this tool for a long time and never see this error before
The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
This error appears when i am trying to open browser, i am not doing nothing before just first step open blowser:
using (var browser = new IE("https://www.itau.com.br#/"))//here it fails
{
//it is not getting in here
//my part of code
step = "1";
#region Login
try
{
browser.WaitForComplete();
linkExist = browser.TextField(Find.ById("campo_agencia")).Exists;
attempt = 40;
while (attempt > 0 && !linkExist)
{
Thread.Sleep(200);
linkExist = browser.TextField(Find.ById("campo_agencia")).Exists;
attempt--;
}
if (linkExist) browser.TextField(Find.ById("campo_agencia")).Value = strUser;
Thread.Sleep(200);
}
catch (Exception ex)
{
}
}
Same times it is working,but in 90% it is not and i get an error.
Do any one know this error , and know how to fix it.
After some research i have found there are Websites that add a reference to the browser (if I am not wrong), and when you launch again it fails. I've made a small change in my code, and now it works every time.
Just use GoTo
after you build:
using (var browser = new IE())
{
browser.GoTo("https://www.itau.com.br#/");
}
User contributions licensed under CC BY-SA 3.0