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

In Browser.cs bug with internal constructor #261

Closed
Testirovishik opened this issue Nov 29, 2018 · 4 comments
Closed

In Browser.cs bug with internal constructor #261

Testirovishik opened this issue Nov 29, 2018 · 4 comments

Comments

@Testirovishik
Copy link

Testirovishik commented Nov 29, 2018

I need to use driver constructor to run tests with Selenium Grid.

This is a workaround I am doing using reflection

public void CreateCRMDriver()
{
Browser browser = CreateInstance<Browser>(new RemoteWebDriver(options));
}

        public static T CreateInstance<T>(params object[] args)
        {
            var type = typeof(T);
            var instance = type.Assembly.CreateInstance(
                type.FullName, false,
                BindingFlags.Instance | BindingFlags.NonPublic,
                null, args, null, null);
            return (T)instance;
        }

but should be simply doing this with a public constructor:

public void CreateCRMDriver()
{
Browser browser = new Browser(new RemoteWebDriver(options));
}
@TYLEROL
Copy link
Member

TYLEROL commented Dec 4, 2018

Thanks for raising this @Testirovishik. We'll review this scenario and provide an update as soon as we can.

Best Regards,
Tyler

@Testirovishik
Copy link
Author

Awesome! Thank you for quick reply!

@TYLEROL
Copy link
Member

TYLEROL commented Dec 6, 2018

Hello @Testirovishik - We're currently working on changes for version 9.1 support for both WebClient and Unified Interface. We don't have an ETA for when we can get this change added in as of yet.

It may be quicker if you're able to put a change together and submit a PR. We could quickly review that and merge it with the appropriate branch.

If not, we'll try to get to this as soon as we can.

Warm Regards,
Tyler

@jlattimer
Copy link
Contributor

RemoteWebDriver support was added in PR #493

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

No branches or pull requests

3 participants