When I attended Microsoft’s Mix-It-Up Session, one of the speakers highlighted the capability of Visual Studio 2008 to generate automatic UI testing. It immediately reminded me of Selenium. So I asked a question about the problem similar to what I had with Selenium. I asked, “Is there anyway to make the UI Testing dynamic so that we can supply list of input values and the expected output values, then it will automatically generate all the asserts?”. The speaker did not answer my question, but he feedback to Microsoft Team that what I asked is something that would be very nice to have in Visual Studio 2008.
I haven’t get my hands dirty with Visual Studio 2008, so I can’t really confirm with what the speaker implied in his feedback to Microsoft *grin*.
Anyway, last weekend I have quite of free time. So I decided to look deeper into Selenium. This time I thread through carefully the Selenium documentation. I finally found what I was looking for. The function is called “storeTable (TableCellAddress, VariableName)”.
Few things that I learned:
When open a pop-up window, you need to have the windowID. WindowID is the variable that holding the reference to that window.var myWindowID = window.open("http://window.url");
After you select the window using SelectWindow, you need to call waitForPageToLoad before accessing any elements inside it. Fail to do this; your test case might throw exception.