Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does WatiN only find by id from a <TR> some of the time?
    text
    copied!<p>I'm trying to do some web automation to login and check the status of an order with WatiN on a dynamically loaded webpage. I'm using Visual Studio C# Express 2010 and an IE browser.</p> <p>A few pieces of code to get the .Text from a <code>&lt;TD&gt;</code> that was working just fine yesterday is no longer working. The <code>&lt;TD&gt;</code> in question contains a <code>&lt;NOBR&gt;</code> and <code>&lt;INPUT&gt;</code>, is this the issue?</p> <p>The text I need is also in the <code>&lt;INPUT&gt;</code> but the tag has no <code>ID</code> or <code>NAME</code> attribute defined and contains inner text/value that isn't the same from test to test. I can not edit the site in question, or this would have been fixed ages ago.</p> <p>The culprit:</p> <pre><code>public TableCell Status { get { return Document.TableCell(Find.ById("elementID")); } } </code></pre> <p>The other TableCells aren't working but TextFields and buttons are just fine. My hunch is that the website is a large one and WatiN is maybe timing out once in a while trying to find the element. I was fairly certain that WatiN only threw the <code>ElementNotFoundException()</code> once it got to the end of the document, though. (???)</p> <p>The form elements weren't fully loading for debugging before reaching them so I thought that might be an issue but the for elements that were NOT elements were all loaded correctly and exists was true for all of them. Besides, that's just a debug issue and it worked fine when I copied the .exe to desktop with my .dll files.</p> <p>I already set my debugger so that "Enable property evaluation and other implicit function calls" is disabled and that didn't help.</p> <p>The method worked when I was running the straight .exe but not through visual studio. Then it stopped working when I rebuilt the very same code and copied the .exe to desktop again.</p> <p>UPDATE: Apparently the web admin of the site to connect to made some changes that broke a bunch of things, so maybe my code is fine after all? I will update again when I get a response from him.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload