When instantiating a new PageFactory class I am receiving the error __"Obtaining the runtime type of a transparent proxy is not supported in this context"__ on all IWebElement expressions and unable to interact with the IWebElement.
This occurs for all IWebElement expressions in build 2.46 (works successfully in 2.45).
Note: _"By"_ expressions are parsed successfully. (see asserts comments in code below)
Assume this error is in relation to the recent .NET PageFactory refactor but unable to resolve.
_SAMPLE:_
using NUnit.Framework;
using OpenQA.Selenium;
namespace SeleniumTests.Tests
{
public class Test : SeleniumBaseClass
{
private IWebDriver driver;
public Test(Browser browser)
{
driver = StartBrowser(Web_Common.Application, browser);
}
[Test, Description("Sample test with NUnit")]
public void Test_MyIWebElement()
{
MyClass thisclass = new MyClass(driver);
driver.Navigate().GoToUrl('sample.test.com')
Assert.That(thisclass.test_A.Displayed); //exception thrown via subject error
Assert.That(thisclass.test_B.Displayed); //returns true
}
....
----------------------------------------
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
namespace SeleniumTests.Web
{
public class MyClass : Web_Common
{
[FindsBy(How = How.Id, Using = "some_ID")]
public IWebElement test_A { get; set; }
public By test_B = By.Id("some_ID");
public MyClass(IWebDriver webDriver)
: base(webDriver)
{
PageFactory.InitElements(webDriver, this);
}
....
----------------------------------------
Unsure if this is a bug or I need to refactor my code to somehow adhere to the .NET PageFactory refactor update. If code refactor, any advice would be helpful.
Visual Studio snapshot:

Thanks
Can you provide a concrete example of what appears to be incorrect? In my simple example, listed below, the test works fine, and does not throw any exceptions. If the issue is one you're having while debugging within Visual Studio, a fully compilable sample with step-by-step instructions would be helpful, along with a description of the version of Visual Studio, and of the .NET Framework you are using.
Page object class (using statements excluded for brevity):
namespace PageObjectTest
{
public class GooglePage
{
[FindsBy(How = How.Name, Using = "q")]
public IWebElement test_A { get; set; }
public By test_B = By.Id("some_ID");
public GooglePage(IWebDriver driver)
{
PageFactory.InitElements(driver, this);
}
}
}
Test class (using statements excluded for brevity):
namespace PageObjectTest
{
[TestFixture]
public class SimpleTest
{
[Test]
public void TestElement()
{
IWebDriver driver = new InternetExplorerDriver();
driver.Url = "http://www.google.com";
GooglePage page = new GooglePage(driver);
Assert.That(page.test_A.Displayed);
driver.Quit();
}
}
}
Compiling and executing this with Visual Studio 2010 and 2013 both execute the test without issue, throwing no exceptions. Furthermore, setting a breakpoint on the driver.Quit() line, I'm perfectly able to use the Visual Studio debugging tools to drill down and view the properties of the object (though I do have to go through some non-public members to get there, as I'm working with a proxy object).
Sorry Jim, was thrown off by the VS 2015 RC debugging error. In my defense, the VS debugging error is rather misleading (see screenshot below - anything with e_* is an IWebElement).
No excuses, user error. Just so happened to be a cascading error affecting many test cases. Grrr.
Thanks for the reply.

Hi guys,
I have the same issue, but I don't understand the point here. What has to be done to resolve this issue?
Thanks!
The same error was occurring in both builds and both versions of VS, but didn't realize it until it was more apparent in VS2015 with the updated debugging screens. If you view the side by side screenshot above, both versions are transcribing a 'transparent proxy' issue.
Unfortunately, I can't recall what the underlying error was with my implementation.
Was this ever resolved? I'm facing the same problem with VS 2015 version 14.0.24720.00 Update 1 and .NET Framework version 4.6.01055. All my page factory elements are not live and I can't interact with them. Same error message displayed at the debugging process "transparent proxy is not supported......"
I am receiving the error "Channel Obtaining the runtime type of a transparent proxy is not supported in this context"
where to set transparent proxy???
Most helpful comment
Was this ever resolved? I'm facing the same problem with VS 2015 version 14.0.24720.00 Update 1 and .NET Framework version 4.6.01055. All my page factory elements are not live and I can't interact with them. Same error message displayed at the debugging process "transparent proxy is not supported......"