magenic / maqs Goto Github PK
View Code? Open in Web Editor NEWMagenic's automation quick start
License: MIT License
Magenic's automation quick start
License: MIT License
Remove Autogenerated docs.
Replace removed docs with new updated docs.
Where I create a new project. Please Help me!
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
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.
Could not upload because:
The icon file has an invalid extension '.ico'. Extension must be one of the following: '.jpg', '.jpeg', '.png'.
Good afternoon, a huge request to consider the possibility of connecting your product to the report portal Allure https://docs.qameta.io/allure/#_get_started.
Thanks you
Maksim
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.
All of the BaseTest projects have the AssemblyVersion, FileVersion and/or Version set to 5.5.1 instead of reflecting the correct version.
Here are the link to the following csproj files with the issues:
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, Dictionary
2 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.
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:
'''
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.
Unit Tests from #67 don't have the needed config settings so the tests fail.
I want code, where is it
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.
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; }
}
The lazy element FindElement and FindElements functions send back standard web elements, but we would prefer that it would return lazy elements
Regions are used sparsely through-out the solution. This issue is to remove the regions from the solution so we have a standard
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:
Scenario 2 – Multiple failures in scenario
Steps:
Expected: Screen shots from steps 5 & 9 attached, no screen shot for step 12
Actual: screen shot taken from Step 12 and attached
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.
Stop updating the project and file names to match with the folder
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:
The hope is that we will be able to implement these components once, and use them for either Java or C# versions of MAQS.
The SpecFlow templates are pretty primitive.
Should add Models like the other templates.
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 .(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.
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.
The MongoDBDriverManager is missing the implementation of the Func<> inside its constructor.
https://github.com/Magenic/MAQS/blob/master/Framework/BaseMongoTest/MongoDriverManager.cs
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.
The template package is empty
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
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.
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.
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
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"
}
}
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.
MAQS is missing MongoDB tests from the CompositeUnitTests project https://github.com/Magenic/MAQS/tree/master/Framework/CompositeUnitTests
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
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?)
Remove Faker generation and unit tests
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>
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);
}
}
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,
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
MAQS 5.5.2
.NetCore 2.2
When a test fails due to a soft assert, two screen shots are captured and both are attached to the test. What I am seeing is the log is that a screen shot is taken at the time of the soft assert failure again at SoftAssert.FailTestIfAssertFailed();
Module1.Selenium.SeleniumTest.MSOAVerifyAppLoads - 2019-09-09-07-35-21-5577.txt
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.
@billros to provide business acceptance criteria
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
When migrating the ADO test cases from Magenic's internal system to the MagenicOpen, the formatting and "Shared Steps" are incorrect.
update version # in project to 5.7
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.