Code Monkey home page Code Monkey logo

maqs's People

Contributors

aaa-bodensteiner-matt avatar acousticguitar avatar bradyrad avatar brannengh avatar cgillum018 avatar chancesuhsen avatar dependabot-preview[bot] avatar dependabot[bot] avatar dylansalmi avatar fermjacob avatar jamesnromach avatar jason-edstrom avatar jeffjagen avatar jeffreyzacher avatar johngagliardi avatar jonreding2010 avatar joshwencl avatar leoliu3 avatar manpreetsinghm avatar mathiasbutala avatar matt-helgerson avatar merihim avatar samwegner avatar skalpin avatar skow0020 avatar troywalshprof avatar vjeffx avatar

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

Watchers

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

maqs's Issues

Error message is displayed


Microsoft Visual Studio

A problem was encountered creating the sub project 'PageModel'. Unable to copy the file 'BasePageModel.cs' from the project template to the project. Cannot find file "C:\Users\User\AppData\Local\Temp\iqjtamzv.3vy\Temp\BasePageModel.cs".

OK

Where I create a new project. Please Help me!

query

Good afternoon, Thank you for your product! he is very cool! I can not wait for you to try methods to databases and mail. We had a desire to tie the Allure, but we ran into the fact that it needed to be inherited from the base test class, which does not have access. Maybe you will also like this report and you will add the opportunity to use it in your product
links in site allure https://github.com/Noksa/Allure.NUnit and general site https://docs.qameta.io/allure/#_get_started

Pre-defined soft-asserts

We should allow tests to "pre-register" the SoftAsserts they intend to check.
If, upon completion, they have not issued a SoftAssert for one of the pre-registered asserts, the test result should be changed to "Inconclusive".

Background: if a test exits pre-maturely (coding logic error), without there being a failed assertion (soft, or otherwise), the test would blindly PASS, hiding an issue.

Error when updating Magenic.Open.Maqs NuGet package from 4.0.4 to 5.0.0

Severity Code Description Project File Line Suppression State
Error Could not install package 'Microsoft.Extensions.Configuration 2.1.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0

Tried clearing the NuGet cache in VS 2017 but that didn't help.

Help!!! Error when use remote

Set appconfig

<!--Browser Resize settings
<add key="BrowserSize" value ="MAXIMIZE"/>
<add key="BrowserSize" value="DEFAULT"/>
<add key="BrowserSize" value="600x1600"/>-->
<add key="BrowserSize" value="MAXIMIZE" />



<!-- Remote browser settings GENERIC - RemoteBrowser can be any standard browser (IE, Firefox, Chrome, Edge or Safari) or use GENERIC and define the browserName in RemoteSeleniumCapsMaqs
<add key="Browser" value="REMOTE"/> -->
<add key="RemoteBrowser" value="Chrome" />
<add key="HubUrl" value="http://{host}:4444/wd/hub" />

<!-- Extended remote browser settings - OS (xp, win7, win8, win8.1, win10, os x, os x 10.6, os x 10.8, os x 10.9, os x 10.10, os x 10.11, solaris, linux, android, +more)-->
<add key="RemotePlatform" value="win10" />

<!-- Extended remote browser settings - Browser version-->
<add key="RemoteBrowserVersion" value="69" />

Unable to create new service: ChromeDriverService
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z'
System info: host: 'AUTOTESTWIN10-1', ip: '{IP}', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: driver.version: unknown (SessionNotCreated)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at Magenic.Maqs.BaseSeleniumTest.SeleniumConfig.Browser(String browser) Unable to create new service: ChromeDriverService Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z' System info: host: 'AUTOTESTWIN10-1', ip: '192.168.0.211', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: unknown (SessionNotCreated) at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at Magenic.Maqs.BaseSeleniumTest.SeleniumConfig.Browser(String browser)
Your web driver may be out of date or unsupported.
at Magenic.Maqs.BaseSeleniumTest.SeleniumConfig.Browser(String browser)
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.GetBrowser()
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.b__6_0()
at Magenic.Maqs.BaseSeleniumTest.SeleniumDriverManager.GetWebDriver()
at Magenic.Maqs.BaseSeleniumTest.SeleniumTestObject.get_WebDriver()
at PageModel.LoginPageModel.OpenLoginPage() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\PageModel\PageModel\LoginPageModel.cs:line 87
at Tests.LogIn.OpenLoginPageTest() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\Tests\Tests\LogInTest\LogIn.cs:line 31
Your web driver may be out of date or unsupported.
at Magenic.Maqs.BaseSeleniumTest.SeleniumConfig.Browser(String browser)
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.GetBrowser()
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.b__6_0()
at Magenic.Maqs.BaseSeleniumTest.SeleniumDriverManager.GetWebDriver()
at Magenic.Maqs.BaseSeleniumTest.SeleniumTestObject.get_WebDriver()
at PageModel.LoginPageModel.OpenLoginPage() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\PageModel\PageModel\LoginPageModel.cs:line 87
at Tests.LogIn.OpenLoginPageTest() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\Tests\Tests\LogInTest\LogIn.cs:line 31
Your web driver may be out of date or unsupported.
at Magenic.Maqs.BaseSeleniumTest.SeleniumConfig.Browser(String browser)
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.GetBrowser()
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.b__6_0()
at Magenic.Maqs.BaseSeleniumTest.SeleniumDriverManager.GetWebDriver()
at Magenic.Maqs.BaseSeleniumTest.SeleniumTestObject.get_WebDriver()
at PageModel.LoginPageModel.OpenLoginPage() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\PageModel\PageModel\LoginPageModel.cs:line 87
at Tests.LogIn.OpenLoginPageTest() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\Tests\Tests\LogInTest\LogIn.cs:line 31
Your web driver may be out of date or unsupported.
at Magenic.Maqs.BaseSeleniumTest.SeleniumConfig.Browser(String browser)
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.GetBrowser()
at Magenic.Maqs.BaseSeleniumTest.BaseSeleniumTest.b__6_0()
at Magenic.Maqs.BaseSeleniumTest.SeleniumDriverManager.GetWebDriver()
at Magenic.Maqs.BaseSeleniumTest.SeleniumTestObject.get_WebDriver()
at PageModel.LoginPageModel.OpenLoginPage() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\PageModel\PageModel\LoginPageModel.cs:line 87
at Tests.LogIn.OpenLoginPageTest() in E:\Git\UI.AutoTest\TravelOracleSite\TravelOracle\Tests\Tests\LogInTest\LogIn.cs:line 31
Test failed
Unable to create new service: ChromeDriverService
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z'
System info: host: 'AUTOTESTWIN10-1', ip: '{IP}', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: driver.version: unknown (SessionNotCreated)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute

Log truncated: To get complete log, select 'Copy All' from the right click menu and then paste into a text editor like Notepad.

EventFiringWebServiceDriver Doesn't Check if the Content is Null before Logging With SafeFormatter

Summary: If you are using the EventFiringWebServiceDriver and there is an endpoint that you are testing that requires the use of PostContent, PutContent, PatchContent, or CustomContent but the value being passed is in a query string instead of in httpcontent, these methods still require some HttpContent to be passed. To bypass this, you can either pass in null or a new HttpContent concrete object. If you choose the former, the method handler will throw an exception because the httpcontent is not checked if it is null.

See method linked below:

private void RaiseEvent(HttpContent content, string actionType, string requestUri, string mediaType)
.
At line 215, the HttpContent is attempted to be used by the safe formatter and throws an exception. This is caught then logged like so:

'''
ERROR: Failed to log event because: System.NullReferenceException: Object reference not set to an instance of an object.
at Magenic.Maqs.BaseWebServiceTest.EventFiringWebServiceDriver.RaiseEvent(HttpContent content, String actionType, String requestUri, String mediaType)
'''

To reproduce, create a new WebServiceTest Project. In one of your test methods, call this.WebServiceDriver.PostContent passing in your test url of choice, "application/json" and null. Check the logs and verify that the above error is found in the logs.

Dependabot couldn't find a Tests.csproj for this project

Dependabot couldn't find a Tests.csproj for this project.

Dependabot requires a Tests.csproj to evaluate your project's current .NET dependencies. It had expected to find one at the path: /Extensions/CoreTemplates/Magenic.Maqs.Email.Template/Maqs Framework - Email1/Tests/Tests.csproj.

If this isn't a .NET project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

LazyMobileElement locators and WinAppDriver

I am working on automating tests for windows application using the Maqs 5.3 and the WinAppDriver.

I would like to take advantage of the LazyElement with the WinAppDriver but it doesnt look like it is supported.

Appium supports supports locator options that are not available in selenium
public W FindElement(string by, string value);
public W FindElement(By by);
public W FindElementByAccessibilityId(string selector);
public W FindElementByClassName(string className);
public W FindElementByCssSelector(string cssSelector);
public W FindElementById(string id);
public W FindElementByLinkText(string linkText);
public W FindElementByName(string name);
public W FindElementByPartialLinkText(string partialLinkText);
public W FindElementByTagName(string tagName);
public W FindElementByXPath(string xpath);

When I look at the LazyModbileElement under BaseAppiumTest I see it is using the OpenQA.selenium locators, not the OpenQA.Selenium.Appium locators. Shouldn't the LazyMobileElement use the Appium locators?

When I try to create a windows element and use the LazyMobileElement I get an error that it cannot convert ...BaseAppiymTest.LazyMobileElement to ...Appium.Windows.WindowsElement.

Here are a couple code snips to help explain what I am trying to do:

private WindowsElement EnterIDNumberField
{
get { return this.TestObject.AppiumDriver.FindElementByAccessibilityId("1") as WindowsElement; }
}

private WindowsElement blah
{
get { return new LazyMobileElement(this.TestObject, By.XPath(@"//someXPathforIdNumberField"),"element") as WindowsElement; }
}

Multiple screen shots are not attached

Issue 1: when a soft assert fails part way through a test a screen shot is still taken of the last page even though the assert on the last page passed.

Issue 2: when a test has multiple soft asserts and more than one of them fail, the screen shots for each failure are not attached.
Looking through the log file and in the log folder I can see that multiple screen shots were taken.

Maqs Version: 5.1.1

Execution: local or grid

Here are the two scenarios I used for testing:
Scenario 1 – One failure in scenario
Steps:

  1. Launch application
  2. Navigate to new page
  3. Soft assert fail
  4. Navigate to new page
  5. Soft assert pass
  6. Navigate to new page
  7. End Test
    Expected: Screen shot from step 3
    Actual: screen shot taken on Step 6 and attached

Scenario 2 – Multiple failures in scenario
Steps:

  1. Launch application
  2. Navigate to new page
  3. Soft assert pass
  4. Navigate to new page
  5. Soft assert fail
  6. Navigate to new page
  7. Soft assert pass
  8. Navigate to new page
  9. Soft assert fail
  10. Navigate to new page
  11. Soft assert pass
  12. Navigate to new page
  13. End Test

Expected: Screen shots from steps 5 & 9 attached, no screen shot for step 12
Actual: screen shot taken from Step 12 and attached

Maqs isn't installed at the VS 2019

Hi Guys!

Microsoft Visual Studio Enterprise 2019
4/3/2019 10:53:15 AM - -------------------------------------------------------
4/3/2019 10:53:15 AM - Identifier : Microsoft.VisualStudio.Component.CoreEditor
4/3/2019 10:53:15 AM - Name : Visual Studio core editor
4/3/2019 10:53:15 AM - Version : [15.0,16.0)
4/3/2019 10:53:15 AM - Error : The prerequisite version specified does not match the version installed
4/3/2019 10:53:15 AM -
4/3/2019 10:53:15 AM - -------------------------------------------------------
4/3/2019 10:53:15 AM - Identifier : Microsoft.VisualStudio.Component.Roslyn.LanguageServices
4/3/2019 10:53:15 AM - Name : C# and Visual Basic
4/3/2019 10:53:15 AM - Version : [15.0.26208.0,16.0)
4/3/2019 10:53:15 AM - Error : The prerequisite version specified does not match the version installed
4/3/2019 10:53:15 AM -
4/3/2019 10:53:15 AM - -------------------------------------------------------
4/3/2019 10:53:15 AM - Identifier : Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites
4/3/2019 10:53:15 AM - Name : .NET desktop development tools
4/3/2019 10:53:15 AM - Version : [15.0.26208.0,16.0)
4/3/2019 10:53:15 AM - Error : The prerequisite version specified does not match the version installed
4/3/2019 10:53:15 AM -
4/3/2019 10:53:15 AM - -------------------------------------------------------
4/3/2019 10:53:15 AM - Identifier : Microsoft.Net.Component.4.7.1.SDK
4/3/2019 10:53:15 AM - Name : .NET Framework 4.7.1 SDK
4/3/2019 10:53:15 AM - Version : [15.6.27406.0,16.0)
4/3/2019 10:53:15 AM - Error : The prerequisite version specified does not match the version installed

But many of the components are installed.

Performance logging enhancements

There is a feature within MAQS that allows test authors to record the elapsed time around requests (web, ui, db... really any block of code).
That feature creates .XML files in the log folder that contain all of the timers.

This feature is envisioned as an add-on to MAQS that will process those XML files into a database.
It will then provide basic analysis of the timers in aggregate, such as average response times, ranges and standard deviation.

It is envisioned that there will be 3 major parts to this feature:

  • A set of SQL scripts that set up the performance timer database
  • A tool for loading the XML files into the database
  • A base set of analysis reports

The hope is that we will be able to implement these components once, and use them for either Java or C# versions of MAQS.

Test is not running after update MAqs 5.3.1

Hi Guys,
I have the problem with running tests after update maqs 5.1 to 5.3.

[3/23/2019 5:00:48 PM Informational] ------ Run test started ------
[3/23/2019 5:00:50 PM Informational] NUnit Adapter 3.13.0.0: Test execution started
[3/23/2019 5:00:50 PM Informational] Running all tests in F:\GitProjects\UITest\Git\Sites\trm\TravelOracleSite\TravelOracle\Tests\bin\Tests.dll
[3/23/2019 5:00:50 PM Informational] NUnit failed to load F:\GitProjects\UITest\Git\Sites\trm\TravelOracleSite\TravelOracle\Tests\bin\Tests.dll
[3/23/2019 5:00:50 PM Informational] NUnit Adapter 3.13.0.0: Test execution complete
[3/23/2019 5:00:50 PM Warning] No test matches the given testcase filter FullyQualifiedName=Tests.LogIn.OpenLoginPageTest in F:\GitProjects\UITest\Git\Sites\trm\TravelOracleSite\TravelOracle\Tests\bin\Tests.dll
[3/23/2019 5:00:50 PM Informational] ========== Run test finished: 0 run (0:00:02.1189314) ==========

Before update tests good working.

I tried to run both through the studio and through the console

Thanks a lot

Dependabot couldn't find a <anything>.(cs|vb|fs)proj for this project

Dependabot couldn't find a .(cs|vb|fs)proj for this project.

Dependabot requires a .(cs|vb|fs)proj to evaluate your project's current .NET dependencies. It had expected to find one at the path: /Extensions/CoreTemplates/<anything>.(cs|vb|fs)proj.

If this isn't a .NET project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

Add Step and/or Action Logging Level in LazyElement

The goal of this issue is to provide a level of logging that can be used to re-create the manual steps one would take to reproduce an automated test, manually.
The first is to add a logging level called "STEP". This would be used by the test case developer to denote a step in the user's scenario.

The second is an ACTION that is taken, on behalf of the user. For UI tests, this would take the form of changing some of the "Information" log messages from LazyElements into "Action" messages. Any action that is directly related to a user input (Sendkeys, click, Hover, etc) should be logged as an ACTION (currently as "INFORMATION")

Our log levels go from "GENERIC", which means success or failure of soft-asserts, to "Information" which (for selenium tests) includes every find-an-element attempt, isVisible, "going to click" and click event. This is a bit TOO detailed. So we would insert them in the following order (more to less detailed order):
VERBOSE
INFORMATION
ACTION
STEP
GENERIC

For web services, this would be the Sending [GET|POST|...] Log messages.

In all cases, wording should be changed to directive voice: "Click" (rather than "Clicking"), "Send" (rather than "sending").

In the "feature/RoskeBill-StepLoggingExample" Branch, in the MAQS/HTMLLogSpec/HTMLLogSpec/Tests/ folder,
I have annotated 2 HTML log files for For Selenium and WebService Tests.
The Orange lines that include "INTENT" are log messages from the test (These might be "step" logs messages from the test)
The Gold lines that follow are the appropriate log messages that should be "ACTION" messages.

Exception recursion

We experience very long logs in case of exceptions. These usually contain like 1000+ repeats of the same exception details, e.g.

no such element: Unable to locate element: {"method":"css selector","selector":"*selector*"}
  (Session info: chrome=75.0.3770.90)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
   at OpenQA.Selenium.Support.Events.EventFiringWebDriver.FindElement(By by)
   at Magenic.Maqs.BaseSeleniumTest.Extensions.Wait.<>c__DisplayClass38_0.<ElementIsVisible>b__0(IWebDriver driver)
   at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)

Based on my analysis, exception is catched here https://github.com/SeleniumHQ/selenium/blob/master/dotnet/src/support/Events/EventFiringWebDriver.cs#L1528 then throws and fires OnExceptionEvent, on which MAQS registers loging https://github.com/Magenic/MAQS/blob/master/Framework/BaseSeleniumTest/SeleniumDriverManager.cs#L281 here https://github.com/Magenic/MAQS/blob/master/Framework/BaseSeleniumTest/SeleniumDriverManager.cs#L182

I'm totally lost where this recursion comes from.

Web Service - Give the user a more friendly error message when the timeout exceeds

Currently when a web service task times out, it gives the user "One or more errors occurred"

It turns out the timeout was hit. The user can change the timeout, but it would be more friendly if we can catch the exception

catch (TaskCanceledException ex)
{
// Check ex.CancellationToken.IsCancellationRequested here.
// If false, it's pretty safe to assume it was a timeout.
}
http://stackoverflow.com/questions/29179848/httpclient-a-task-was-cancelled

http://stackoverflow.com/questions/19120675/httpclient-task-was-cancelled-how-to-get-the-exact-error-message

.Net Core GetWithResponse() Error

I am moving some API Tests over to a .Net Core project from a project that was on 4.7.1 The tests are failing on the GetWithResponse() method. How should I get the response in a .Net Core project?

MQAS: 5.5.0

var response = this.TestObject.WebServiceDriver.GetWithResponse(APIEndpoints.ProcessDateEndpoint, "application/json", true);

Message:
Test method Tests.API.APITests.ProcessDateTest threw exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

Stack Trace:
at WebServiceDriver.ctor(HttpClient httpClient)
at WebServiceDriverManager.GetWebServiceDriver()
at APITests.ProcessDateTest() in Tests.cs line: 55

I have removed System.Net.Http.Formatting from the project since it is not supported in .Net Core.

Add dropdown support for LazyElements

We have element handlers for the following methods:

SelectDropDownOption
SelectDropDownOptionByValue
GetSelectedOptionFromDropdown
GetSelectedOptionsFromDropdown

it would be nice if we could call these methods on a Lazy Element because the Select methods require a By currently.

This would also add the Lazy Element logging on these controls.

Web service test timeouts can be to low for debugging

The web service default timeouts in the templates are currently 1 second. This is often not enough time for the debugger to do it's thing, especially for the Visual Studio debugger.

Suggest bumping up the default timeout to 5 seconds

Screenshot and Log does not attach - .Net Core 2.0

I have setup a simple project to work though moving our test automation to .Net Core 2.X and I am finding that the log file and screen shots are not showing up in the output for a failed test.

Version: 5.5.0
TargetFramework: Netcoreapp2.0
Selenium: 3.141
Chrome Driver: 76.0.3 (latest)
IE: 3.141.59
Environment: Local machine, no gird

Test:
public void VerifyAppLoads()
{
HomePageModel homePage = new HomePageModel(TestObject, true);
homePage.WaitForPageLoad();

        this.SoftAssert.IsFalse(true, "Force Fail");
        this.SoftAssert.FailTestIfAssertFailed();
    }

Appsettings.json:
{
"MagenicMaqs": {
"WaitTime": "100",
"Timeout": "10000",
"Log": "OnFail",
"LogLevel": "VERBOSE",
"LogType": "TXT",

},
"SeleniumMaqs": {
"WebSiteBase": "https://siteurl.com/",
"Browser": "Chrome",
"HubUrl": "http://ourhubmachine:4444/wd/hub",
"RemoteBrowser": "Chrome",
"SeleniumCommandTimeout": "60000",
"BrowserWaitTime": "100",
"BrowserTimeout": "10000",
"BrowserSize": "MAXIMIZE",
"SoftAssertScreenshot": "Yes",
"ImageFormat": "Png",
"SavePagesourceOnFail": "NO"
},
"RemoteSeleniumCapsMaqs": {
"Username": "Sauce_Labs_Username",
"AccessKey": "Sauce_Labs_Accesskey",
"BrowserName": "Chrome",
"Platform": "OS X 10.11",
"Version": "54.0"
}
}

Appium Script not running due to " webDriver.Manage().Window.Maximize();" line

We are trying to integrate appium with MAQS framework. The following error was found after executing a simple script.
unknown error: operation is unsupported on Android
(Session info: chrome=60.0.3112.107)
(Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platform=Windows NT 6.3.9600 x86_64).

This problem is appearing due to a code bug in BaseTest--> SeleniumConfig.cs-->Browser function. The code is highlighted in the attached screenshot. Maximize window command don't work in appium.
capture

Help to connect TestRail

I have a situation when I need to connect the integration with TestRail. But I did not find in the open spaces instructions how to do this with examples other than official documentation, but I could not figure out how to do it. I would be very grateful if someone would tell if someone has experience with this integration.

Thanks,
Maksim

Core templates not working on Machines with .Net Core 3 installed

The latest version of the Microsoft.NET.Test.Sdk package is not working nicely with .NetCore 2
microsoft/vstest#2189

The result is that when we build a Core template on a system that has Core 3 installed we get the following error

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0234	The type or namespace name 'TestPlatform' does not exist in the namespace 'Microsoft.VisualStudio' (are you missing an assembly reference?)

Timeout configuration in 5.4

After upgrading from 4.0.5 to 5.4.0 we experience issues with waits.
E.g. this code doesn't wait for anything
testObject.WebDriver.Wait().ForPageLoad();
If I wait for page load with static thread sleep, I am able to fill and check forms, however, when I wait for anything, the test ends with "Message: System.TimeoutException : Page load took longer than timeout configuration".

The same code worked in the older version. I've extended timeouts in app.config, but that doesn't seem to affect anything as this fail is almost instant. Any ideas what's wrong here?

<configSections>
    <section name="MagenicMaqs" type="System.Configuration.NameValueSectionHandler" />
  </configSections>
  <MagenicMaqs>
    <add key="Browser" value="Chrome" />
    <add key="WaitTime" value="1000" />
    <add key="Timeout" value="30000" />
    <add key="Log" value="OnFail" />
    <add key="LogLevel" value="INFORMATION" />
    <add key="LogType" value="TXT" />
    <add key="ImageFormat" value="Png" />
  </MagenicMaqs>

Implement better LazyElement logging

I noticed that we don't include the action name (e.g. Click(), GetValue(), Submit()) in the LazyElement error logs. It appears that info can be easily made available in most/all situations. In other frameworks I've written, users have found this added info to be valuable.

The "top-level" exception's message could look something like:
ProfileLink could not be found when you called Click

 private IWebElement GetElement(Func getElement, [CallerMemberName] string callerName = "")
        {
            // Try to use cached element
            if (this.CachedElement != null)
            {
                try
                {
#pragma warning disable S1481
                    // Do this to make sure we waited for the element to exist
                    bool visible = this.CachedElement.Displayed;
#pragma warning restore S1481
                    return this.CachedElement;
                }
                catch (Exception e)
                {
                    this.TestObject.Log.LogMessage(MessageType.VERBOSE, "Refinding element because: " + e.Message);
                }
            }
            try
            {
                this.TestObject.Log.LogMessage(MessageType.VERBOSE, "Performing lazy driver find on: " + this.By);
                this.CachedElement = getElement();
                return this.CachedElement;
            }
            catch (Exception e)
            {
                StringBuilder messageBuilder = new StringBuilder();
 
                messageBuilder.AppendLine(this.userFriendlyName + " could not be found when you called " + callerName);
 
                messageBuilder.AppendLine("Failed to find: " + this.userFriendlyName);
                messageBuilder.AppendLine("Locator: " + this.By);
                messageBuilder.AppendLine("Because: " + e.Message);
 
                throw new Exception(messageBuilder.ToString(), e);
            }
        }

App.config & Config.Json runtime validation

PBI Statement

As a Maqs user I would like to look at a pre Navigate log in the case of a WebBrowser.Navigate exception. This log would tell me if the App.config options had any misleading configuration or even missing sections. The logging would need to be done in Config.cs and have knowledge of a "good" state. All log entries must be user friendly to directly point them to the area of concern and a possible solution.

Recreate:
To recreate this problem create a new MAQs Selenium Test project. Go to the app.config and get rid of any RemoteCapsMaqs section and related sections underneath as shown in this image.

But leave HubURL in....

Now, go ahead and try to run a test. If you have the MAQS base code which doesn't care the commented section is gone, you'll now hit the RemoteWebDriver attempting to navigate to the default HubURL which fails saying there's no userid or password, while this error message is true it will totally confuse an end user if their current configuration does not have content.

Possible Solutions,

  • Move Hub URL into Remote Caps section along with the Remote Browser setting (keep all concerns in same section), if all parms are not correct log or throw exception.
  • Rework Config.cs to have a flight recorder which is seen when logging level is verbose or something similar.
  • Throw an exception at earliest possible point to notify the user "app.config has invalid configuration. The message must be user friendly

Implement .Exists inside of LazyElement

Add a .Exists() feature on Lazy elements that will check whether a Lazy Element exists in the dom. This would be a useful value item for Angular projects where things like .Display() cannot always be used without causing an error.

Two methods:

Exists() which hits the timeout
ExistsNow() which checks to see if it exists

Parameter override in Assembly Initialize

We have an API Utility class that is setup to get the authentication cookie that is needed in the test. Currently the urls, parameters and end points are pulled from the app config. I would like to override them from the run settings file. The APIUtility class is getting called as part of the assembly initialize.

ex: Config.GetGeneralValue("APICookieURL", "https://default.com")

I would like to change these parameters at run time from Azure so we can run against multiple environments (dev, test, stage... ). To do this I am adding the parameters in the .runsettings file.

ex: Parameter name="MagenicMaqs:APIBaseURI" value ="https://someurl.com"
Parameter name="MagenicMaqs:APICookieURL" value="https://otherurl.com"

When I run an api test, it is not pulling in the values from the .runsettings file.

If I move the call to the APIUtility class to the Test Initialize then the parameters are overwritten as expected.

Remote execution via PowerShell

There are instances (especially in the Financial Services sector) where commands must be executed on a specific machine (such as batch processing). Powershell provides us the ability to execute commands on the local AND/OR remote machines, in both synchronous and asynchronous modes.

A nice primer article is at:
https://blogs.msdn.microsoft.com/kebab/2014/04/28/executing-powershell-scripts-from-c/

Remote execution is more interesting, depending on if we have access to Powershell 5.0. In 5.0, a new remote execution capability was added to Powershell and the API that goes with it. In versions before 5.0, the Invoke-command Powershell command can be used on the local powershell to execute a command of the remote machine. In 5.0, most commands can communicate with an open session in PS.

Another option is to go DIRECTLY to the remote machine. A better solution, as it does not require PS installed on the local machine. A primer is available at:https://com2kid.wordpress.com/2011/09/22/remotely-executing-commands-in-powershell-using-c/

Another good reference: https://msdn.microsoft.com/en-us/library/ee706591(v=vs.85).aspx

Ability to coordinate use of shared resources (users) across test

Often times, we are given credentials for an application under test.
Rather than storing them in the AppConfig we could store them in a data store of some sort (DB).

Why a DB?
Sometimes those credentials must be shared, but there is a limit as to how many sessions can be active per user. An example is, the application (re)stores the state of a user’s actions across sessions. This can cause issues with parallel execution, as parallel sessions could affect each other.
With a DB we could define multiple creds under the same“credential name”, such that a query for the user will get the next available uid for that “credential name”.

Then the test(er) can “check out” the credentials for a period of time and know that they “own it” for that time. Once done, they can “check back in” or the timer will expire, making the user available again.

Note: Passwords are expected to be stored into a Vault

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.