Page 1 of 1

How to change effective timeout

Posted: Wed Apr 17, 2019 8:07 pm
by IvanT
How to change effective timeout "element" from user code???
i don't have this element in repository.

while(true){
try{
Element element = Host.Local.FindSingle("//rawtext[@rawtext='skv-210']");
to do ...
break;
}
catch(ElementNotFoundException){
//I leaf to the next page
repo.GEOTOOLSУ.Form65280.Down.Click();
}

Re: How to change effective timeout

Posted: Thu Apr 18, 2019 7:55 am
by odklizec
Hi,

If you mean effective timeout for element searched via FindSingle, then EffectiveTimeout does not apply here. EffectiveTimeout is just repository-related thing. In case you want shorten FindSingle search time, you can do this by adding duration parameter, like this:

Code: Select all

Host.Local.FindSingle("//rawtext[@rawtext='skv-210']", 5000);

BTW, I would suggest to pass both xpath and repo element to your code via method's argument (as string and repoiteminfo variable nad then convert the repoiteminfo to adapter). Using xpaths and repo elements directly in code, as you do it now, only creates messy and unsustainable code. Sure, it's (a bit) faster to type the repo element and xpath directly in code. But it will take much longer to maintain and even understand such messy code. You will see in few months as your project will grow up ;)