Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when calling FindElement on WrappedElement #5

Open
Exoow opened this issue Mar 27, 2016 · 3 comments
Open

Exception when calling FindElement on WrappedElement #5

Exoow opened this issue Mar 27, 2016 · 3 comments

Comments

@Exoow
Copy link

Exoow commented Mar 27, 2016

I'm calling this code from a TestMethod:

class TheInternet
    {
        [FindsBy(How = How.LinkText, Using = "Hovers")]
        private Link lnk1;
        public TheInternet(IWebDriver driver)
        {
            HtmlElementLoader.PopulatePageObject(this, driver);
        }

        public void DoStuff()
        {
            lnk1.WrappedElement.FindElement(By.XPath("self"));
        }

    }

The resulting error is this:

Result StackTrace:
bij CallSite.Target(Closure , CallSite , Object , By )
bij System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
bij ActLike_IWebElement_3d48e16bd9ab45a1ba77091907bedc73.FindElement(By by)
bij HtmlElements.Tests.TestPages.TheInternet.DoStuff() in C:\Users\Frederik\Desktop\htmlelements-dotnet-master\HtmlElements-DotNet\HtmlElements-Tests\Tests\TestPages\TheInternet.cs:regel 24
bij HtmlElements.Tests.AnnotatedHtmlElementPageTest.HHEEELLLP() in C:\Users\Frederik\Desktop\htmlelements-dotnet-master\HtmlElements-DotNet\HtmlElements-Tests\Tests\AnnotatedHtmlElementPageTest.cs:regel 20
Result Message:
Test method HtmlElements.Tests.AnnotatedHtmlElementPageTest.HHEEELLLP threw exception:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Yandex.HtmlElements.Loaders.Decorators.ProxyHandlers.WebElementNamedProxyHandler contains no definition for FindElement

@Exoow Exoow changed the title Exception when called FindElement on WrappedElement Exception when calling FindElement on WrappedElement Mar 27, 2016
@iangavr
Copy link

iangavr commented Aug 22, 2017

It looks like this port has some specifics with implementation of element proxies (since there are no default dynamic Proxy implementation in C# as in Java). I stumbled upon that when was trying to use the HtmlElement or TypifiedElement with IJavaScriptExecutor.

Otherwise I'd say that the port is good. HtmlElements in Java may now have some opponents, though in C# there aren't too many.

@artkoshelev @HardNorth I understand that this port is not supported that much, but maybe we can discuss shortly if there is a possibility to polish it a bit? I am willing to help, though would have been good to hear your input as you might know more about details.

@iangavr
Copy link

iangavr commented Aug 22, 2017

@Exoow try doing it using the HtmlElement directly, and not its WrappedElement

@artkoshelev
Copy link
Contributor

@iangavr i don't have any knowledge on this implementation, but you are welcome to send your 'polishing' PR's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants