Watin throws exception when Attach to IE - watin

I am using for my Automation framework but I keep getting this error:
System.InvalidCastException: Specified cast is not valid.
IE newIE = IE.AttachTo<IE>(Find.ByUrl(new Regex("test.aspx")));
What is the cause for this? Thanks!

Please make sure you have added 'Interop.SHDocVw' reference and make 'Embedded Interop' property to 'False'. Also try to the test with admin rights.
Thanks,
Sham_

Related

Property 'isiOSOnMac' not found on object of type 'NSProcessInfo'

I am having this issue on specific system only(Mac mini). how can I resolve this?
You just need to comment that block of code where you are having this error.
after that you are able to make a build successfully.

System Extension Validation Fails

im trying to submit a Network Extension activation request but i get this error.
The operation couldn’t be completed. (OSSystemExtensionErrorDomain error 9.)
I looked it up and apparently it means "validationFailed". Is there a way to debug this because i cant seem to figure out why the validation is failing. Thanks.
Finally found the solution. You need to set the NEMachServiceName property on the Info.plist of the extension to match the app group name.

What is the GlobalIdentity and how do I set it in the FileNet web service?

I'm trying to upload a document into filenet via CEWS, but I'm getting this error:
“The unexpected exception is chained to this exception. Message was: com.filenet.apiimpl.core.GlobalIdentity incompatible with com.filenet.apiimpl.core.RepositoryIdentity“
Our Filenet people don't seem to know what that means. They've provided working code that basically looks the same as mine (but which I can't compile directly at the moment because it references parts of their project I don't have.)
So is the GlobalIdentity something I need to pass in through the web service? If so, how? If not, where is it configured?
Ok I finally spotted my mistake.
I had incorrectly set crt.TargetSpecification.classId to the name of the repository I was trying to use rather than to the correct classId.

WMI GetObject Error

On Windows XP, in my vbscript, I am using
GetObject("winmgmts:\.\root\cimv2")
to get WMI service object, but always get error: (null): Invalid syntax. I checked the syntax, it should be ok. I even tried to rebuild the Repo as suggested here , but still got the same error. I guess it might be permission/security policy issue. Any suggestions?
Your syntax is wrong you are missing a \
instead use
GetObject("winmgmts:\\.\root\cimv2");
or even better you can get the instance of the WMI class directly including the WMI path
GetObject("winmgmts:\\.\root\cimv2:Win32_LogicalDisk='C:'")

When testing with WatiN: "'DebuggerDisplayProxy()' threw an exception of type 'System.InvalidCastException'"

FrameworkActionsLink = CurrentBuyerSite.BuyerWorkAreaFrame.Link(Find.ById("actions"));
I have code which finds a link element by finding by ID.
The HTML on the page is:
<a id="actions" href="Javascript:ShowMenuItem('options','actions'); ... >
I have excluded the full Javascript code in the href where you see "...".
On test execution, sometimes this code works correctly, but sometimes I get the following error:
'DebuggerDisplayProxy()' threw an exception of type
'System.InvalidCastException'
It's a pretty straightforward bit of code, I just wondered if anyone had experienced similar problems or error messages. Do you think this is an issue with the WatiN tool, the web application, the internet browser, or perhaps something else entirely?
Can you try the following code:
FrameworkActionsLink = (WatiN.Core.Link)CurrentBuyerSite.BuyerWorkAreaFrame.Link(Find.ById("actions"));
I'm pretty sure that it doesn't like the link being JavaScript:...
Edit: Try maybe this:
CurrentBuyerSite.Eval("ShowMenuItem('options','actions'); ...");
What runner are you using? if nUnit 64bit then try 32bit or other runner.
Maybe the issue is that page didn't fully download and that makes problem with javascript function, try replace Click() for ClickNoWait().

Resources