Git Product home page Git Product logo

ocaramba's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocaramba's Issues

How to use FirefoxDriver?

Hello, thanks for the tool.

Breaks with:

One or more errors occurred.
  Exception doesn't have a stacktrace

System.InvalidOperationException
Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line (SessionNotCreated)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxOptions options)
   at Objectivity.Test.Automation.Common.DriverContext.Start()

app.config:

    <add key="browser" value="Firefox" />

packages.config

  <package id="Objectivity.Test.Automation.Common.xUnit" version="3.1.3" targetFramework="net462" />
  <package id="Selenium.Support" version="3.11.2" targetFramework="net462" />
  <package id="Selenium.WebDriver" version="3.11.2" targetFramework="net462" />
  <package id="Selenium.WebDriver.ChromeDriver" version="2.38.0" targetFramework="net462" />
  <package id="Selenium.WebDriver.GeckoDriver" version="0.20.1" targetFramework="net462" />
  <package id="Selenium.WebDriver.IEDriver" version="3.11.1" targetFramework="net462" />

In PATH: `"C:\Program Files\Mozilla Firefox".

FF 59.0.2 (64-bit)

Change of DriverContext.CrossBrowserEnvironment data-type from string to BrowserType causing issues

Nuget Version: 3.1.8

DriverContext.CrossBrowserEnvironment

Prior to v3.1.8, since this was a string, we could have something like the following (a Browser-Platform string combo):

  <appSettings>
    <add key="CrossBrowserEnvironment" value="ChromeWindows" />
  </appSettings>

  <environments>
    <ChromeWindows>
      <add key="browser" value="chrome" />
      <add key="os" value="Windows"/>
      <add key="os_version" value="10"/>
      <add key="resolution" value="1366x768" />
    </ChromeWindows>
    <ChromeMac>
      <add key="browser" value="chrome" />
      <add key="os" value="OS X"/>
      <add key="os_version" value="High Sierra"/>
    </ChromeMac>
    <ChromeAndroid>
      <add key="os_version" value="7.1"/>
      <add key="device" value="Google Pixel" />
      <add key="real_mobile" value="true" />
    </ChromeAndroid>
  </environments>

Since it was a generic string, it would populate the settings properly:
NameValueCollection settings = ConfigurationManager.GetSection("environments/" + this.CrossBrowserEnvironment) as NameValueCollection;

But with the new change to BrowserType in v3.1.8, we no longer have this flexibility in naming the CrossBrowserEnvironment to suit our needs...Thoughts?

NOTE: This is NOT a blocker, as I have a workaround by handling it DriverContext_DriverOptionsSet handler...

Css Selector : Issue

CSSSelector : "[class='dropdown-menu inner']ul>li:visible"

I am using above mentioned selector in chrome colsole and it return me list of elements.

image

When i use the same selector in the framework, i am getting Invalid selector.
image

Could you Please suggest if I am doing Anything wrong here.

How to use GetElements method in proper way to support Linq.

How do i Write linq on getElment or getElements methods.

I am trying to select an element from a list of item based on the text property.
ex:
lstMainMenu = new ElementLocator(Locator.CssSelector, "#sideMenu >li")
var mainmenu = this.Driver.GetElements(lstMainMenu);
var x= mainmenu.Where(e => e.Text.Contains("HOME"));

then i will do some action.

i am getting below error:

Let me know if i am using this methods in correct ways.

  Name Value Type
  Error Evaluation of method System.Linq.SystemCore_EnumerableDebugView`1[OpenQA.Selenium.IWebElement].get_Items() calls into native method Microsoft.Win32.SafeNativeMethods.QueryPerformanceCounter(long&). Evaluation of native methods in this context is not supported.  

thanks
Vipin

Integration with SauceLab

Hi -

I am using your framework and trying to integrate to SauceLab.

Still it throwing up error.

Where should I pass credentials to the Remote Webdriver Hub ?

Passing Browser Name From CI Tool

Hi, Can we have some mechanism here so that we can pass which browser to execute tests against from CI tool or from command line?

CS50001 Program does not contain a static Main method suitable for an entry point

Hi - I have cloned this specflow automation framework. When i click on run button i see below error message . Please help me on it.

Visual studio cannot start debugging because the debug target 'C:\users].......' is missing. Please build the project and retry , or set the outputpath and asseblyname properties appropriately to pint at the correct location for the target assembly

CS50001 Program does not contain a static Main method suitable for an entry point

Parallel test runs using different browsers

Very well written framework some excellent ideas, thank you! 👍

One question, if I wanted to run the Nunit tests or any other tests, in parallel, on different browsers, how can that be achieved getting data from app.config file?

Regards

Option to clean browser/re-instantiate browser between tests?

All my tests run sequentially in the same instance of a browser, which causes problems if tests need to isolate behavior per session.

I realize spinning up the browser is an expensive operation, but it seems necessary in certain circumstances. I'd be willing to try to force a delete of cookies between tests, but I can't see where Driver.Manage.DeleteAllCookies() is an option off the DriverContext in the TearDown method.

As always, am I missing something obvious?

Cant use Find Element chain

Hello.
someElement.GetElement() throws exception "cant cast "EventFiringWebElement" to "OpenQA.Selenium.IWebDriver".

How to start WebDriver (Chrome) in a separate window (console)?

If Selenium tests generated for xunit are run using xunit test runner then output is placed in the console. And Test.Automation runs a WebDriver such that it outputs into the same console, see this line. How to run a WebDriver in a separate window. So that CI process can capture output of it separately? Should it be somehow ChromeDriverService as per this doc?

Support for PhantomJS

Hi, thanks for this lib!
How to make it to use PhantomJs? No such driver listed at Test.Automation/Objectivity.Test.Automation.Common/BrowserType.cs and it throws System.NotSupportedException : Driver None is not supported when <add key="browser" value="PhantomJs" />

Overriding ChromeDriver issue.

When i am running Mstest, Chrome driver is lanched and test cases are exectuted.
I created build pipeline in VSTS for the same. I tried to Run the test cases, Chrome driver is not launched, and test cases are failing as this.DriverContext.Start(); thows exception regarding chromedriver path.

So to resolve this i made changes in app.config as suggested in BaseConfiguration.
I am getting below error. " (unknown error: DevToolsActivePort file doesn't exist) ".
Provided Path of Local ChromeDriver:

I also added ChromeArguments in App.config
image

May be i am missing something, couls guys please help.

App.Config changes

image

Error:
OpenQA.Selenium.WebDriverException: 'unknown error: Chrome failed to start: was killed
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Driver\chromedriver.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5),platform=Windows NT 10.0.17134 x86_64)'

Selenium Grid Support

I started using Test.Automation, but now am thinking of moving to Selenium Grid. It seems this framework does not support it.

I am thinking of implementing it. Just want to check first whether it is already planned or under development, not to duplicate effort.

FF not loading add-ons during test runs

Hi,

I've added a reference in app.config to an extension I need to run (uBlock since some internal firewall issues cause 3rd party scripts to take forever to load). I have installed the extension on the default profile, and it's present when I launch FF manually, but from Selenium, FF loads without any add ons.

The reference I made in app.config loads the .xpi in previous versions of FF (e.g. 47.0.1) but doesn't load it in FF 54.0.1.

I also changed the reference to not load the default profile, but when loading a custom profile (which DOES include the add on in FF 54.0.1) test start times were upwards of 1 minute.

Is this a limitation in this recent build of Firefox, or have I (yet again) tried to implement it incorrectly? What should the value reference be for the plugin if the key value is the path?

Identifying best approach to automate

I’m automation tester. I’m trying to identify best test automation approach. My application is developed in C# (DB : SQL Server) and I need to write test automation scripts for UI, DB and REST services. I have below two options available.

  • Selenium + C#
  • Selenium + Java
    What do I need to consider before going to decide one of the above?
    If I go with Selenium + Java, I think I need to have below:
    Maven, Java, IDE(Eclipse), Bamboo or Jenkins(For CI), Bit bucket(For source code), Cucumber, Junit
    If I go with Selenium + C#, what do I need?

Thanks for your help in advance !!

HP ALM (QC) integration

Hi

This framework is powerful, is it possible to add another feature to connect HP ALM (Quality Center) to run or update back results using ALM API.

Thanks
Thulasi

Make KendoSelect element type configurable

Our implementation of the Kendo dropdown list has a select element instead of the input element. I was able to interact with our dropdowns by updating the target element from input to select here:
https://github.com/ObjectivityLtd/Test.Automation/blob/960057855c402fd9f145cbf21685c7c0d771bd8d/Objectivity.Test.Automation.Common/WebElements/Kendo/KendoSelect.cs#L42

The Telerik demo page has 2 dropdowns. The first one uses input, second one uses select.

https://demos.telerik.com/jsp-ui/dropdownlist/index

Why DriverContext is not singleton (or inside a singleton)?

Hi,

To leave out passing DriverContext throughout the tests I have moved it to a custom singleton. Tests became much clearer for QA Engineers.

Was thinking about the reason It is not implemented as such. I can PR my changes if you're interested.

Eduard

Can't find DataDrivenHelper

Hi, I'm trying to use the DataDrivenHelper class in the latest version for NUnit (3.1.7).

My project can't find the DataDrivenHelper though.

I've even tried the example imports:
https://github.com/ObjectivityLtd/Test.Automation/wiki/NUnit-DataDriven-tests-from-Xml,-CSV-and-Excel-files

using Objectivity.Test.Automation.Tests.NUnit.DataDriven;

It can't find the Tests namespace after Automation. Am I missing something?

Error	CS0234	The type or namespace name 'Tests' does not exist in the namespace 'Objectivity.Test.Automation' (are you missing an assembly reference?)

Regards

Reason not to use Selenium.Support

I was wondering if there is a reason why the framework accesses elements like this:

private readonly ElementLocator
            linkLocator = new ElementLocator(Locator.CssSelector, "a[href='/{0}']"),
            basicAuthLink = new ElementLocator(Locator.XPath, "//a[contains(text(),'Auth')]");

rather than the Selenium.Support method:

    [FindsBy(How = How.Id, Using = "Username")]
    private IWebElement _username;

    [FindsBy(How = How.Id, Using = "Password")]
    private IWebElement _password;

    [FindsBy(How = How.Id, Using = "login-button")]
    private IWebElement _loginbutton;

I'm curious whether this is a conscious design decision. If so, why?

Noob Questions/Issues Possibly...

Hey there! I'm embarking on using Ocaramba as a part of a larger framework test module project. We use MSTest as our unit framework, and I'm wondering EXACTLY what I would need to add to my package dependency for the project in order to reap the benefits of ALL of Ocaramba.

Presently, I have added the Ocaramba.MSTest nuget package to my manager, however the NLog references are not being honored, even though it appears that the package has downloaded.

Do I have to explicitly include all of the source code from Ocaramba in my framework project, or is it all included as part of the Ocaramba.MSTest nuget?

Thank you!

In Driver Context all internetExplorer preferences from app.config file are not getting set to driver

private InternetExplorerOptions InternetExplorerOptions
{
get
{
// retrieving settings from config file
var internetExplorerPreferences = ConfigurationManager.GetSection("InternetExplorerPreferences") as NameValueCollection;
var options = new InternetExplorerOptions
{
EnsureCleanSession = true,
IgnoreZoomLevel = true,
};

            // set browser proxy for IE
            if (!string.IsNullOrEmpty(BaseConfiguration.Proxy))
            {
                options.Proxy = this.CurrentProxy();
            }

            // custom preferences
            // if there are any settings
            if (internetExplorerPreferences == null)
            {
                return options;
            }

            // loop through all of them
            for (var i = 0; i < internetExplorerPreferences.Count; i++)
            {
                Logger.Trace(CultureInfo.CurrentCulture, "Set custom preference '{0},{1}'", internetExplorerPreferences.GetKey(i), internetExplorerPreferences[i]);

                // and verify all of them
                switch (internetExplorerPreferences.GetKey(i))
                {
                    case "EnsureCleanSession":
                        options.EnsureCleanSession = Convert.ToBoolean(internetExplorerPreferences[i], CultureInfo.CurrentCulture);
                        break;

                    case "IgnoreZoomLevel":
                        options.IgnoreZoomLevel = Convert.ToBoolean(internetExplorerPreferences[i], CultureInfo.CurrentCulture);
                        break;
                }
            }

            return options;
        }
    }

Dynamic Ids

I am really impressed with the Automation framework. It's really amazing.

We use Sencha ExtjS for our web application which generates dynamic ids. Any idea how we can build the test case around it smartly.

Where is Main method ?

I have cloned specflow framework and trying to run. Please help me on running thus framework. I did not see main method on it.

Chrome: Unable to cast object of type 'OpenQA.Selenium.Remote.ReadOnlyDesiredCapabilities' to type 'OpenQA.Selenium.Remote.DesiredCapabilities

When a test is run on Chrome (Windows/Android) combination (BrowserStack)…

System.InvalidCastException:
Unable to cast object of type 'OpenQA.Selenium.Remote.ReadOnlyDesiredCapabilities' to type 'OpenQA.Selenium.Remote.DesiredCapabilities'.
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
at Objectivity.Test.Automation.Common.DriverContext.SetCapabilities()
at Objectivity.Test.Automation.Common.DriverContext.Start()

No Html reports

how to get HTML reports with this frame work for selenium tests using MS Test frame work

FireFox >47.01

OS: Win 10
FF: Anything > 47.01
Selenium: 3.4
Geckodriver: 0.18.0

I've got a project with ObjectivityNUnit package installed per the getting started section of the wiki. FF 47.01 runs fine, Chrome runs fine. I know in Selenium 3 you need to automate through Geckodriver for FF versions > 47, so I installed most recent Geckodriver binary and added it to my path.

When I execute a test with newer FF (I've tried 32 bit versions of every major and several minor releases between 47 and 54), the browser launches but never navigates. Stepping through it, the test stops in the OneTimeSetup at this.DriverContext.Start(). error as below:

Result Message: OneTimeSetUp: OpenQA.Selenium.WebDriverException : Failed to start up socket within 45000 milliseconds. Attempted to connect to the following addresses: 127.0.0.1:7055

I honestly feel like I am missing a step, does Geckodriver factor into this at all?

KendoDropDownList doesn't seem to work for Kendo Angular

Good afternoon,

Is is possible to make the Kendo RemoteWebElements work for the Angular version of the controls. The angular drop-down as an example can be seen here: https://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/

As expected, when trying to initialise a KendoDropDownList element results in the following error, because the main part of the control i not a span, and the span below it doesn't have the k-widget class

NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"./ancestor-or-self::span[contains(@class, 'k-widget')]//*[@id]"}

Thanks in advance.

Objectivity.Test.Automation framework + SpecFlow

Hello - I have a Specflow based test project that I based on your example using the ProjectTestBase.cs. provided. When I run the test for my features, I can walk through the code for ProjectTestBase and the DriverContext initializes properly for the driver that I am using but when the BeforeTest method goes out of scope, so does the DriverContext and scenarioContext.

As I debug my version of CommonSteps, the DriverContext is passed in but with a null driver member variable. ScenarioContext is null too.

What modificationx should I include in my steps classes in order to get them to work with the DriverContext and ScenarioContext from the ProjectTestBase class:? My step classes, like your CommonSteps class are not derived from any base classes.

Thank you
Chris

Parallel Execution SpecFlow using Zalenium

Hi,

Very well written framework, thank you for all your efforts.

I'm using SpecFlow with NUnit and trying to run tests in parallel using Zalenium however I'm getting an error when running tests.

I have set the below properties in App.config file.

<add key="browser" value="RemoteWebDriver" />
<add key="DriverCapabilities" value="Chrome" />
<add key="RemoteWebDriverHub" value="http://localhost:4444/wd/hub" />

Below is the error I'm getting.
image

Does anyone here know what this error is and how it can be resolved?

Thank you,

More flexibility around Browser Capabilities

My scenario requires that I have more control around setting browser capabilities. I have created a branch which creates a new event on the DriverContext that allows me to hook into the pipeline to add more capabilities at runtime.

The branch is here: https://github.com/gregpakes/Test.Automation/tree/custom-capabilities

I haven't created a PR as it contains checkins from other branches I have submitted PRs for.

Please let me know if this is of interest to you and how I should go about submitting a PR.

Ocaramba.Features starts 5 instances of Chrome per test

As the title says, I'm running Ocaramba.Features (3.1.15) with SpecFlow 2.4.1, and every time I run my tests in VS2015 Pro Update 3 (unfortunately, command-line testing is off limits at this job so I can't even test it), it launches 5 instances of Chrome per test.

I have only slightly modified my ProjectTestBase -- the changes are as follows....

 [Before]
        public void BeforeTest()
        {
           /* Everything is the same up to this line... */
            this.DriverContext.DriverOptionsSet += DriverContext_DriverOptionsSet;

            this.DriverContext.Start();
            this.scenarioContext[nameof(this.DriverContext)] = this.DriverContext;
        }

 private static void DriverContext_DriverOptionsSet(object sender, DriverOptionsSetEventArgs args)
        {
            if (args == null || args.DriverOptions == null)
            {
                throw new ArgumentNullException();
            }

            args.DriverOptions.AddAdditionalCapability("useAutomationExtension", false);
        }

And my App.config is unchanged other than the host value, which is aimed at my localhost.

I'm not sure what I need to change to get down to one instance of Chrome.

I can share my code, but this job has gists blocked, and has the machines locked down so hard that I can't push code up. If you need to see anything, I'll have to paste it here. :(

Performance Measure - need improvements (report on the specific page/action in the log)

Performance Measure - need improvements (report on the specific page/action in the log)

Hi Team of the Objectivity Ltd.

Thank you for the great framework. There I have improvement request.
As far as I can see the performance measured in the following implementations:
public class PerformanceHelper.

There is line in the function 'public void StopMeasure':
Logger.Info(CultureInfo.CurrentCulture, "Load Time {0}", this.MeasuredTime);

Which produces line in the Log as:
|Info|Objectivity.Test.Automation.Common.Helpers.PerformanceHelper.StopMeasure|Load Time 1316

Looks like it is would be very helpful if the function will just return the measured value instead of putting it in the log.

There would be easier to report on specific actions (page loads). There is property which is not accessible from the outside:
private long MeasuredTime

Another option to expose the duration is: timer.ElapsedMilliseconds, which is also private.

My implementation would be as the follows (in the PerformanceHelper class):

        public double StopMeasureDuration(string title)
        {
            this.timer.Stop();
            var savedTimes = new SavedTimes(title);
            this.MeasuredTime = this.timer.ElapsedMilliseconds;
            savedTimes.SetDuration(this.MeasuredTime);

            this.loadTimeList.Add(savedTimes);

            return this.MeasuredTime;
        }

Please let me know if you see this as feasible implementation!
Thank you!

Reporting and integrations with TFS for CI

Hi,
can you provide more details on how the reporting would be when we run mutiple test cases? Can we integrate this with TFS and define TFS builds to run the solution?

Help with Parallelization please

Hello everyone, thank you for all your efforts.

I am trying to run the same Feature file (Login.feature) test steps for Google and IE in parallel, but I am running into some issues. As you can see below, the LoginFeature test class in Login.feature.cs is not getting appended with an NUnit parallelizable atribute ([NUnit.Framework.ParallelizableAttribute()])

[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "2.2.0.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Login")]
public partial class LoginFeature
{

Changing and saving the App.config is not having any effect on LoginFeature test class even after I click "Yes" to the usual "Do you want to regenerate the feature files now." message.

Here are my setting from App.config

........

I changed the os_version from 10 to 7 since my PC is running on Windows 7.

The app only launches IE, not Chrome.

Your help will be appreciated.

Thank you.

Burak

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.