title,body,link,tags,view_count,is_answered,score,answer_count
Example - regression testing,"<p>There remain two questions:</p>

<ol>
<li>When I add or modify a module in the implementation of a use case it is necessary to repeat the tests to verify that other use cases have not been influenced by the modification.</li>
<li>This test is called regression testing.</li>
</ol>

<p>Do you think that this is Right?</p>
",https://stackoverflow.com/questions/52823911/example-regression-testing,"['testing', 'regression']",104,False,1,1
Maintenance vs regression testing,"<p>Could any one explain to me the difference between maintenance tests and regression tests? The too types are used after a modification in the software.
Thanks.</p>
",https://stackoverflow.com/questions/52403587/maintenance-vs-regression-testing,['testing'],1314,False,0,1
Regression Testing Heroku Request Timeout,"<p>My Rails app currently has a thumbnail upload endpoint which frequently times out on Heroku due to the 30 second request limit. I use <a href=""https://github.com/carrierwaveuploader/carrierwave"" rel=""nofollow noreferrer"">Carrierwave</a> and would like to switch to <a href=""https://github.com/dwilkie/carrierwave_direct"" rel=""nofollow noreferrer"">CarrierWaveDirect</a> to solve the problem by doing direct to S3 uploads.</p>

<p>Before I do so, I would like to write a regression test and see it fail with a request timeout. How can I do that?</p>

<p>Most of my tests are high level Selenium/capybara tests, so I tried writing one which stubs the controller action to always throw a timeout error:</p>

<pre><code># Simulates 30 second Heroku timeout for thumbnail uploads.
context 'when PATCH requests timeout' do
  before do
    allow_any_instance_of(Api::V1::VideosController).to receive(:update).and_wrap_original do |m, *args|
      if request.content_type == 'multipart/form-data'
        raise Net::HTTPRequestTimeOut
      else
        m.call(*args)
      end
    end
  end

  it 'uploads custom thumbnails direct to S3' do
    signup_and_verify_email(signup_intent: :seller)
    visit_store_via_upload_link
    upload_test_video
    upload_thumbnail
  end
end
</code></pre>

<p>This fails because <code>request</code> is undefined in the context of the block. Before I go further with this, whats the best way to write a test for this scenario?</p>
",https://stackoverflow.com/questions/52805023/regression-testing-heroku-request-timeout,"['ruby-on-rails', 'testing', 'heroku', 'carrierwave', 'carrierwave-direct']",53,False,1,0
Percy Visual Regression Testing - First Run,"<p>Trying to find out what exactly happens the first time Percy is run against Storybook. I've looked through the docs and can't spot a 'clear' answer. Is it:</p>

<ol>
<li>Current state is taken as the default baseline for images without human intervention </li>
<li>A human is required to 'approve' the current state for each image</li>
<li>Depends - you can control Percy so it can be either 1 or 2 (link to the docs would be great)</li>
<li>Something else</li>
</ol>

<p>Help would be appreciated. </p>
",https://stackoverflow.com/questions/53414404/percy-visual-regression-testing-first-run,"['testing', 'automated-tests', 'storybook', 'visual-testing']",149,False,0,1
Are teams adopting BDD for regression testing?,"<p>Have been hearing a lot about BDD with Selenium being adopted for regression testing. Are teams using BDD for writing regression tests? I am asking about automating test cases for a decent consumer based application like a banking app. </p>
",https://stackoverflow.com/questions/49004404/are-teams-adopting-bdd-for-regression-testing,"['testing', 'testng', 'regression', 'bdd']",818,False,-3,3
Comparing multiple columns in a table: Regression Testing,"<p>I am currently performing regression testing and would like to write a query which automatically compares the values in columns between two tables. Hoping to automate this feature in the future too.</p>

<p>Essentially checking each and every cell.</p>

<p>We are currently using an Oracle and MSSQL based environment.</p>

<p>E.G.</p>

<pre><code>Table A:

Column 1 |  Column 2 | Column 3
  540        EQUITY    10-09-12

Table B:

Column 1 |  Column 2 | Column 3
  330        CASH      10-03-11
</code></pre>

<p>Help would be greatly appreciated. </p>
",https://stackoverflow.com/questions/48217088/comparing-multiple-columns-in-a-table-regression-testing,"['oracle', 'testing', 'compare', 'regression']",101,False,0,1
Azure API Management - Regression testing and Performance testing of APIs,"<p>Are there any built-in options to perform Regression testing and Performance testing of APIs in Azure API Management? If not, are there any options to do that within the Azure ecosystem (like VSTS Performance tests tool etc.)? Thanks!</p>
",https://stackoverflow.com/questions/52097418/azure-api-management-regression-testing-and-performance-testing-of-apis,"['azure-devops', 'azure-api-management']",1479,True,1,1
How do I perform regression testing on let&#39;s encrypt certificate issuance?,"<p>I am a web hosting provider who provides free HTTPS certificates to the domain owners on my platform automatically using Let's Encrypt.</p>

<p>I need to be able to test out repeatedly the process of issuance of certificates for a domain. Since I do not have unlimited domains to test with, I need to be able to fully reset all certificates or any process that have occurred on a domain so I can repeat the process in a test suite.</p>

<p>How can I do this ?</p>

<p>I am using Node/Express and greenlock as my server software.</p>
",https://stackoverflow.com/questions/50019911/how-do-i-perform-regression-testing-on-lets-encrypt-certificate-issuance,"['node.js', 'lets-encrypt', 'greenlock']",29,False,0,1
Selenium regression testing on page templates which may or may not be switched on,"<p>Our dev team are working on new page templates which include lots of changes to the locators on those pages. These new pages are on a toggle so they may or may not be present at any time in our test environments depending on whether they are toggled on or off.
An id is in the header which I can use to identify if the new page template is toggled on.
Can anyone tell me the best way to handle this. Ideally I would like to add the new locators to the relevant page object and not put them in a properties file.</p>

<p>Current locator and WebElement:</p>

<pre><code>@FindBy(className = ""add-to-cart-btn"")
    WebElementFacade addToCartBtn;
</code></pre>

<p>New locator on new template:</p>

<pre><code>className = ""quickOrderSubmit""
</code></pre>
",https://stackoverflow.com/questions/48867242/selenium-regression-testing-on-page-templates-which-may-or-may-not-be-switched-o,"['java', 'selenium-webdriver', 'pageobjects', 'serenity-bdd']",191,False,0,1
Select Excel cells by condition and paste them into Word as an image,"<p>For my software regression test I use Excel to compare numerical values between reference and release candidate version:   </p>

<p><strong>Header of Excel sheet for regression testing:</strong><br>
<a href=""https://i.stack.imgur.com/ztDIm.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/3dejE.png"" alt=""img""></a>  </p>

<p><strong>Body of Excel sheet for regression testing:</strong>    </p>

<p><a href=""https://i.stack.imgur.com/eE5ES.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Crdmk.png"" alt=""img2""></a><br>
This data is copied by the following vba macro as an image to Word:  </p>

<pre><code>Sub Copy2Word()

Dim ZeilenAnzahl As Integer
Dim MaxBlock As Integer
Dim i As Integer
Dim Copyrange, Zelle As String
ZeilenAnzahl = 80
MaxBlock = 10

Dim objWord, objDoc As Object
ActiveWindow.View = xlNormalView

Set objWord = CreateObject(""Word.Application"")
Set objDoc = objWord.Documents.Add

For i = 1 To MaxBlock
    Startrow = 1 + (i - 1) * ZeilenAnzahl
    Lastrow = ZeilenAnzahl + (i - 1) * ZeilenAnzahl
    Let Zelle = ""A"" &amp; Startrow
    If IsEmpty(Range(Zelle).value) = False Then
       Let Copyrange = ""A"" &amp; Startrow &amp; "":"" &amp; ""I"" &amp; Lastrow
       Range(Copyrange).Select
       Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
       objWord.Visible = True
       objWord.Selection.Paste
       objWord.Selection.TypeParagraph
    End If
Next i

End Sub  
</code></pre>

<p>The macro groupes 80 lines of the Excel sheet to one image. I want to change this in a manner that only lines are selected which have a real deviation (Column ""G"") bigger than the permissible deviation (Column ""D""). The macro shall collect 80 lines which fulfill this condition and copy them to Word or copy the rest if now more lines are found.  </p>

<p>How would you realize this?</p>
",https://stackoverflow.com/questions/50562859/select-excel-cells-by-condition-and-paste-them-into-word-as-an-image,"['vba', 'excel']",327,True,-1,2
Azure API Management - Regression testing and Performance testing of APIs,"<p>Are there any built-in options to perform Regression testing and Performance testing of APIs in Azure API Management? If not, are there any options to do that within the Azure ecosystem (like VSTS Performance tests tool etc.)? Thanks!</p>
",https://stackoverflow.com/questions/52097418/azure-api-management-regression-testing-and-performance-testing-of-apis,"['azure-devops', 'azure-api-management']",1479,True,1,1
Are teams adopting BDD for regression testing?,"<p>Have been hearing a lot about BDD with Selenium being adopted for regression testing. Are teams using BDD for writing regression tests? I am asking about automating test cases for a decent consumer based application like a banking app. </p>
",https://stackoverflow.com/questions/49004404/are-teams-adopting-bdd-for-regression-testing,"['testing', 'testng', 'regression', 'bdd']",818,False,-3,3
Example - regression testing,"<p>There remain two questions:</p>

<ol>
<li>When I add or modify a module in the implementation of a use case it is necessary to repeat the tests to verify that other use cases have not been influenced by the modification.</li>
<li>This test is called regression testing.</li>
</ol>

<p>Do you think that this is Right?</p>
",https://stackoverflow.com/questions/52823911/example-regression-testing,"['testing', 'regression']",104,False,1,1
Comparing multiple columns in a table: Regression Testing,"<p>I am currently performing regression testing and would like to write a query which automatically compares the values in columns between two tables. Hoping to automate this feature in the future too.</p>

<p>Essentially checking each and every cell.</p>

<p>We are currently using an Oracle and MSSQL based environment.</p>

<p>E.G.</p>

<pre><code>Table A:

Column 1 |  Column 2 | Column 3
  540        EQUITY    10-09-12

Table B:

Column 1 |  Column 2 | Column 3
  330        CASH      10-03-11
</code></pre>

<p>Help would be greatly appreciated. </p>
",https://stackoverflow.com/questions/48217088/comparing-multiple-columns-in-a-table-regression-testing,"['oracle', 'testing', 'compare', 'regression']",101,False,0,1
automating the tests where application running under citrix xenapp,"<p>I am hardly trying to automate some of the scripts for regression testing in the application, but the challenge am facing over here is, the application running under the <strong><em>Citrix XenApp</em></strong> so am not able to automate it in a usual way(Selenium &amp; UFT) please anyone help me to find the way to automate the application under citrix :)</p>
",https://stackoverflow.com/questions/50724315/automating-the-tests-where-application-running-under-citrix-xenapp,"['automation', 'automated-tests', 'citrix', 'xenapp']",281,False,1,1
Testing Google Apps Script web app with QUnit,"<p>I have a Google Apps Script web app, that previously worked, but when I tried to add some code to the ""server-side"", it broke the app. I wish to go back in and do some unit testing and possibly a bit of regression testing (even though my manual regression testing just failed), on the different functions and modules of this app. </p>

<p>I stumbled upon <a href=""https://github.com/simula-innovation/qunit/tree/gas/gas"" rel=""nofollow noreferrer"">this library for GAS unit testing</a> and a <a href=""http://www.tothenew.com/blog/how-to-test-google-apps-script-using-qunit/"" rel=""nofollow noreferrer"">tutorial for using the library</a>. Problem is that, to actually see the results of the test, you must implement a <code>function doGet(e)</code> for testing. </p>

<p>This app I'm trying to unit-test, being a web app, already has that function. Its implementation is as follows: </p>

<pre><code>function doGet(e) {
  return HtmlService.createTemplateFromFile(
    'potholeMap'
  ).evaluate()
   .setTitle('Pothole Map')
   .setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
</code></pre>

<p>When I bring in the QUnit library dependency, and refactor it to allow QUnit testing, such as below: </p>

<pre><code>function doGet(e) {
    var TESTING = true; 
    if (TESTING)
    {
        QUnit.urlParams(e.parameter);
        QUnit.load(function test() {});
        return QUnit.getHtml();
    }

    return HtmlService.createTemplateFromFile(
        'potholeMap'
    ).evaluate()
        .setTitle('Pothole Map')
        .setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
</code></pre>

<p>I get this error when I try to run it: <code>Authorization is required to perform that action.</code> How do I fix this so that I can do unit testing in the project, as well as run it as web app?</p>
",https://stackoverflow.com/questions/49054019/testing-google-apps-script-web-app-with-qunit,"['google-apps-script', 'testing', 'web-applications', 'qunit']",935,True,0,2
automated test for SSRS reports,"<p>I have 187 reports in a live SSRS/SSAS scenerio.  I have a requirement to update the cube all of the reports are feeding from.  The requirement is spawned from a change request to one of the reports.</p>

<p>Is there a quick way to determine whether or not I have broken all the other reports based on the new cube design (in short terms, how do I perform automated regression testing?)</p>

<p>Thanks much!</p>
",https://stackoverflow.com/questions/50219423/automated-test-for-ssrs-reports,"['reporting-services', 'ssas', 'ssrs-2012']",347,True,1,1
"NULL values, regression / correlation switch","<p>I have a dataset with lets say 2 variables. I want to do some regression testing, but the quite a few numeric observations have ""NULL"". I would want to use this as a value however, but I don't want to convert it to a specific number, ie 99999.</p>

<p>I keep trying all the different ways after googling and it doesn't work.</p>

<pre><code>Benny2 &lt;- read_excel(""C:/Users/EH9508/Desktop/Benny2.xlsx"")
</code></pre>

<p>I have two variables <code>""Days""</code> and <code>""Amount""</code>  both have numeric values and ""NULL""</p>

<p>Any help would be appreicated.</p>
",https://stackoverflow.com/questions/51498287/null-values-regression-correlation-switch,"['r', 'null', 'correlation']",81,True,0,1
How to know are there any ajax calls are in inprocess in a page using javascript,"<p>I am doing regression testing on a web page where all actions are simulating automatically using some testing tool.Here I faced one issue is, we can check entire page is loaded are not by using javascript method </p>

<pre><code>document.readyState === ""complete""
</code></pre>

<p>But it will not validate for a partial page loading which is happening by ajax requests/responses.Is there any way to find any ajax calls are still being processed in a page.</p>

<p>My main motto is, I would like to wait for until page is loaded completely including ajax requests and responses and proceed actions after completion of it.</p>
",https://stackoverflow.com/questions/50286072/how-to-know-are-there-any-ajax-calls-are-in-inprocess-in-a-page-using-javascript,"['javascript', 'jquery', 'ajax']",121,False,1,1
Running Boost.Test without main method invocation,"<p>I'm trying to test parts of my code. I wrote the following <code>test.h</code> file:</p>

<pre><code>#include &lt;boost/test/unit_test.hpp&gt;

BOOST_AUTO_TEST_CASE(my_test) {
    BOOST_CHECK(true);
}
</code></pre>

<p>If I run the test, my application's main method is invoked and since the command line arguments are missing, it terminates. I want to just run the test suite as it is and succeed since <code>BOOST_CHECK</code> on <code>true</code> should be a passed test. Once this works, I would add calls to functions from my code base one by one for regression testing. Is this possible to do? If yes, how?</p>

<p><a href=""https://stackoverflow.com/a/12535953/3764804"">This post</a> suggests adding the following define to the top of the <code>test.h</code> file but it does not work for skipping the main method invocation:</p>

<pre><code>#define BOOST_TEST_NO_MAIN true
</code></pre>
",https://stackoverflow.com/questions/53958618/running-boost-test-without-main-method-invocation,"['c++', 'linux', 'boost', 'clion', 'boost.test']",237,True,1,1
"printf(), unsigned char, and %hhd","<p>The program:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;limits.h&gt;

int main( void )
{
#ifdef __CHAR_UNSIGNED__
    printf( ""%d\n"", __CHAR_UNSIGNED__ );
#endif
    printf( ""%d\n"", CHAR_MAX );
    printf( ""%d\n"", CHAR_MIN );
    printf( ""%hhd\n"", CHAR_MAX );
}
</code></pre>

<p>Output (on my x86_64 desktop):</p>

<pre><code>127
-128
127
</code></pre>

<p>That is as expected. Now, I ran the same on a Raspberry Pi (ARM):</p>

<pre><code>1
255
0
-1
</code></pre>

<p>So... <strong>apparently I have misunderstood</strong> some step <code>CHAR_MAX</code> is taking in its way to output, as <strong>the output I was expecting</strong> in that last line -- passing <code>CHAR_MAX</code> to <code>%hhd</code> on a machine with <code>char</code> being unsigned -- <strong>would have been <code>255</code></strong>.</p>

<p>(And if you should ask, the result is the same for <code>(char)CHAR_MAX</code>, and <code>(unsigned char)CHAR_MAX</code>.)</p>

<p>What am I missing?</p>

<p>This happened to me during regression testing my own <code>printf()</code> implementation on the Raspberry Pi -- which, by the way, <em>does</em> print <code>255</code>. So... only one implementation is doing it right, and I have the sinking feeling it's not mine...</p>
",https://stackoverflow.com/questions/51141245/printf-unsigned-char-and-hhd,"['c', 'printf']",4714,True,0,1
How to create a script tag helper that inherits from the standard .Net Core script tag helper,"<p>I maintain a large legacy ASP.NET MVC application, which was recently converted to .Net Core.</p>

<p>I need to introduce cache busting for our JavaScript and CSS files. I appreciate this can easily be done using the <em>asp-append-version=""true""</em> attribute on the new .Net Core script tag helper.</p>

<p>However, my application has script tags in over a 100 places. Adding the attribute in all those places will touch large numbers of pages, which means a lot of regression testing.</p>

<p>Is there a way to create a new script tag helper that inherits from the .Net Core script tag helper, and that always has the <em>asp-append-version=""true""</em> attribute? That will give me cache busting without having to update lots of files.</p>
",https://stackoverflow.com/questions/50958531/how-to-create-a-script-tag-helper-that-inherits-from-the-standard-net-core-scri,"['asp.net-core', 'asp.net-core-tag-helpers']",3028,True,4,1
Is it possible to take device independent screenshots with Puppeteer?,"<p>I am using Puppeteer to do visual regression testing (specifically I am using the jest-image-snapshot library for this). Unfortunately, when I use machines with different screen characteristics, the screenshots are slightly different and the tests fail. For example, I have a test where the screenshot was originally taken on a non-retina Mac display, but when the test runs on a Mac with a retina display there are minor differences in the screenshot that make the test fail.</p>

<ol>
<li>Is it possible to take screenshots with Puppeteer that are independent of the display used?</li>
<li>I tried to force a non-retina screenshot on a retina display by calling <code>setViewport</code>, but that didn't help: <code>page.setViewport({width: 800, height: 600, deviceScaleFactor: 1});</code></li>
<li>Are there any other screenshoting tools/techniques that address this issue? </li>
</ol>
",https://stackoverflow.com/questions/51432175/is-it-possible-to-take-device-independent-screenshots-with-puppeteer,"['jestjs', 'puppeteer', 'jest-image-snapshot']",223,False,3,0
predictable pseudo-random list with multiprocessing,"<p>I have a script which uses multiprocessing to create a list of pseudo random numbers. A simplification of which looks like this:</p>

<pre><code>import os, multiprocessing
import numpy as np    

def generate_random_number(i):
    np.random.seed()
    return np.random.uniform(0, 100)

pool = multiprocessing.Pool(os.cpu_count() - 1)
rand_list = pool.map(generate_random_number, range(10))
print(rand_list)
</code></pre>

<p>And the output looks like that:</p>

<pre><code>[77.57457867285069, 72.53197844139046, 13.197630136723138, 64.9476430895216, 61.91057931216751, 43.436320344539446, 0.16208332066368625, 11.226294184830632, 20.325312826899765, 28.020558284894005]
</code></pre>

<p>In order to do regression testing, I want to be able to seed the randomness, in a fashion which will still give me pseudo random numbers, but the same numbers every time. I tried the following:</p>

<pre><code>def generate_random_number(i):
    return np.random.uniform(0, 100)

    np.random.seed(123)
    pool = multiprocessing.Pool(os.cpu_count() - 1)
    rand_list = pool.map(generate_random_number, range(10))
    print(rand_list)
</code></pre>

<p>but then all workers start with the same seed, so I get:</p>

<pre><code>[69.64691855978616, 69.64691855978616, 69.64691855978616, 69.64691855978616, 69.64691855978616, 69.64691855978616, 28.613933495037948, 28.613933495037948, 28.613933495037948, 28.613933495037948]
</code></pre>

<p>The same number is always repeated as many times as the pool has workers.</p>

<p>Is there a way for me to seed the randomness in such a way that will always give me the same list, but with a seemingly random list, regardless of the amount of workers?</p>
",https://stackoverflow.com/questions/49492911/predictable-pseudo-random-list-with-multiprocessing,"['python', 'random', 'multiprocessing', 'seed']",73,False,1,0
What level of detail is required in gherkin formatted test scenarios to support automated testing?,"<p>I manage a testing team and the developers want our documented test scenarios to create automated regression testing (of a web-based tool). Our scenarios are written in gherkin format (Given/When/Then) but I'm wondering how much detail is needed to support automated testing? For example, our 'Then's are pretty general like </p>

<p>'then the user should be asked to select their country' </p>

<p>but do not include the specifics like where the drop down box should be, what values should be in it, what font size it should be, what order the options should be in, etc. </p>

<p>How much detail will they need? </p>

<p>I don't know what tool they are using for automation yet, they are still evaluating the options. Possibly Selenium. </p>
",https://stackoverflow.com/questions/52191002/what-level-of-detail-is-required-in-gherkin-formatted-test-scenarios-to-support,"['selenium', 'testing', 'automated-tests', 'gherkin']",74,True,0,1
Unable to execute the windows bash script on Jenkins slave,"<p>As a part of regression testing need to run the bash script on windows machine which actually open the chrome browser and traverse the website and generate the test report.</p>

<p>when i try to execute it through jenkins all the test cases are getting failed as its unable to open the browser, the same is getting passed when we logon to the remote windows server and execute the script manually.</p>

<p><strong>NOTE:</strong> Have provided the same credentials on jenkins slave windows service</p>

<p>found below log on event manager</p>

<blockquote>
  <p>Activation of app Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI failed with error: This app can't be activated by the Built-in Administrator. See the Microsoft-Windows-TWinUI/Operational log for additional information.</p>
</blockquote>

<p><a href=""https://i.stack.imgur.com/E5g7C.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/E5g7C.png"" alt=""Jenkins slave service config""></a></p>

<p>Could you please help me here..</p>
",https://stackoverflow.com/questions/53723425/unable-to-execute-the-windows-bash-script-on-jenkins-slave,"['windows', 'google-chrome', 'jenkins', 'jenkins-cli', 'jenkins-slave']",181,True,0,1
Numpy rounds in a different way than python,"<p>The code</p>

<pre><code>import numpy as np
a = 5.92270987499999979065
print(round(a, 8))
print(round(np.float64(a), 8))
</code></pre>

<p>gives</p>

<pre><code>5.92270987
5.92270988
</code></pre>

<p>Any idea why?</p>

<p>Found nothing relevant in numpy sources.</p>

<p><strong>Update:</strong><br>
I know that the proper way to deal with this problem is to construct programs in such a way that this difference is irrelevant. Which I do. I stumbled into it in regression testing.</p>

<p><strong>Update2:</strong><br>
Regarding the @VikasDamodar comment. One shouldn't trust the <code>repr()</code> function:  </p>

<pre><code>&gt;&gt;&gt; np.float64(5.92270987499999979065)
5.922709875
&gt;&gt;&gt; '%.20f' % np.float64(5.92270987499999979065)
'5.92270987499999979065'
</code></pre>

<p><strong>Update3:</strong><br>
Tested on python3.6.0 x32, numpy 1.14.0, win64. Also on python3.6.4 x64, numpy 1.14.0, debian.</p>

<p><strong>Update4:</strong><br>
Just to be sure:</p>

<pre><code>import numpy as np
a = 5.92270987499999979065
print('%.20f' % round(a, 8))
print('%.20f' % round(np.float64(a), 8))

5.92270987000000026512
5.92270988000000020435
</code></pre>

<p><strong>Update5:</strong><br>
The following code demonstrates on which stage the difference takes place without using <code>str</code>:</p>

<pre><code>&gt;&gt;&gt; np.float64(a) - 5.922709874
1.000000082740371e-09
&gt;&gt;&gt; a - 5.922709874
1.000000082740371e-09
&gt;&gt;&gt; round(np.float64(a), 8) - 5.922709874
6.000000496442226e-09
&gt;&gt;&gt; round(a, 8) - 5.922709874
-3.999999442783064e-09
</code></pre>

<p>Clearly, before applying 'round' they were the same number.</p>

<p><strong>Update6:</strong><br>
In contrast to @user2357112's answer, <code>np.round</code> is roughly 4 times slower than round:</p>

<pre><code>%%timeit a = 5.92270987499999979065
round(a, 8)

1.18 µs ± 26.5 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)  

%%timeit a = np.float64(5.92270987499999979065)
round(a, 8)

4.05 µs ± 43.9 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
</code></pre>

<p>Also in my opinion <code>np.round</code> did a better job rounding to the nearest even than builtin <code>round</code>: originally I got this 5.92270987499999979065 number through dividing 11.84541975 by two.</p>
",https://stackoverflow.com/questions/48638398/numpy-rounds-in-a-different-way-than-python,"['python', 'numpy', 'rounding-error', 'rounding']",1236,True,8,4
Compare two tables from 2 different DBMS,"<p>My company is preparing to migrate a datawarehouse from Sybase IQ to DB2.
They will do it internally without any third party software.</p>

<p>They are asking me to develop something to compare pre-migration and post-migration databases, i.e. compare schemas and datas for every table in order to perform regression testing.</p>

<p>I don't want to reinvent the wheel so I'd like to find a tool  which already exists, I did find a couple e.g. ApexSQLDiff, RedGate SQL Compare etc.</p>

<p>But there are two problems : </p>

<ul>
<li>Most of them don't handle Sybase IQ DBs</li>
<li>None of them are free and my company is looking for something free (they would consider to pay though if it's not too expensive) </li>
</ul>

<p>Do you have any tool that would allow me to do so ? Or any clues to help me to program something to do it ? </p>

<p>Regards</p>
",https://stackoverflow.com/questions/51058331/compare-two-tables-from-2-different-dbms,"['sql', 'database', 'db2', 'sybase', 'business-intelligence']",74,False,0,0
VBA - How to call a module with arguments from Application.Run?,"<p>This is driving me nuts. </p>

<p>Using VBA Access, I'm attempting to set up a regression testing suite for a database application we're developing. I want to traverse a table, and call each module and function listed in the table using Application.Run (that way, when a developer creates a new feature, they can just create their regression test module, and list it in the table).</p>

<p>I would assume I would do this with Application.Run.</p>

<p>The code snippet I have works:</p>

<pre><code>If folderName &lt;&gt; """" Then
    Dim test1 As String: test1 = ""regCOTSImporter""
    Dim test2 As String: test2 = ""regressionTestCOTS""

    Application.Run regCOTSImporter.regressionTestCOTS(foldername)
End If
</code></pre>

<p>Now, I would assume that </p>

<pre><code>Application.Run regCOTSImporter.regressionTestCOTS, foldername
</code></pre>

<p>would work as well, but it does not, because VBA fails at finding the procedure claiming that the argument is not optional (even though the documentation for Application.Run lists further arguments as parameters...)</p>

<p>However, ideally I want regCOTSImporter and regressionTestCOTS to be replaced by test1 and test2 respectively, as Dim'd above -- that way instead I load them from the DB. However, if I do the following:</p>

<pre><code> Application.run test1 &amp; ""."" test2 &amp; ""("" &amp; foldername &amp; "")""
</code></pre>

<p>I get a message saying that the procedure cannot be found. What do I need to do in order to be able to call this module.function from a String?</p>

<p>Thanks in advance!</p>
",https://stackoverflow.com/questions/48064610/vba-how-to-call-a-module-with-arguments-from-application-run,"['vba', 'ms-access', 'regression']",1961,True,0,2
Coded UI Tests in Visual Studio 2017 stop working after the software I am testing updates. Does this happen to others?,"<p>I have gone through and made multiple coded UI tests for a web application written in C#. These tests that I created were specifically for regression testing. I would test the UI of this application to make sure that previously working aspects were still working after new updates rolled out.</p>

<p>Now the problem that I am running into is the CUIT completely do not work after each update. The newer updates do not touch any of preexisting features that I am testing, yet the CUIT do not run at all. It will sit there, load for a minute, and then tell me the tests have failed. </p>

<p>Now, if I go through and recreate some of these CUIT on the new update and run them, they work fine. However, to make all of the tests that I need, it would take hours and hours every single day of updates and completely negate the purpose of making the automated tests. </p>

<p>So I was wondering if this is a common occurrence that other people know how to deal with. Any help would be extremely appreciated. </p>
",https://stackoverflow.com/questions/50864657/coded-ui-tests-in-visual-studio-2017-stop-working-after-the-software-i-am-testin,"['c#', 'visual-studio', 'coded-ui-tests']",58,False,0,0
Puppeteer getting response from pdf download link,"<p>I'm automating regression testing for a website and one of the tasks is to verify pdf downloads. I'm using Puppeteer and Chromium for this. I've found that it's rather difficult to download files in headless mode. Instead of downloading the file, I thought it might be prudent to look for a response from the page and the size of the file. My issue: when I try to navigate to the page, nothing seems to happen. I receive a timeout error. Here is the code I'm attempting to use:</p>

<pre><code>const filename = new RegExp('\S*(\.pdf)');
await page.waitForSelector('#download-pdf', {timeout: timeout});
console.log('Clicking on ""Download PDF"" button');
const link = await page.$eval('#download-pdf', el =&gt; el.href);
await Promise.all([
    page.goto(link),
    page.on('response', response =&gt; {
        if(response._headers['content-disposition'] === `attachment;filename=${filename}`){
            console.log('Size: ', response._headers['content-length']);
        }
    })
]);
</code></pre>

<p>EDIT</p>

<p>If anyone understands how <code>page.goto()</code> ignores <code>.pdf</code> pages, that will be very useful to me.</p>

<p>Let me define the problem better. Upon clicking the <code>download pdf</code> button on the webpage, an event is triggered that generates the pdf file and sends the user along a unique url. This url is destroyed after a short period. In order to get to this point, I believe that I must use <code>page.click()</code> to trigger the event and generate the url. However, <code>page.click()</code> is also attempting to navigate to the pdf url, which is rejected in headless mode. What I need to do is get the url and test for a response from it.</p>
",https://stackoverflow.com/questions/52881159/puppeteer-getting-response-from-pdf-download-link,"['javascript', 'node.js', 'puppeteer']",3094,True,4,1
Unit test to ensure all required services are added to the .Net Core DI container,"<p>My team maintains a very large .Net Core 2.1 web site. Lots of controllers, lots of services that get injected into the controllers via constructor injection.</p>

<p>Sometimes due to developer error a service class is no longer added to the DI container during startup. Obviously this leads to an exception when MVC tries to construct a controller that relies on that service (in response to an incoming request). </p>

<p>Problem is that this may affect only some lightly used controller, so our (far from perfect) regression testing doesn't pick up the regression bug. But it is still bound to be picked up by one of our (very demanding) customers.</p>

<p>I though of writing a unit test that would</p>

<ol>
<li>Instantiate a ServiceCollection class (that implements IServiceCollection);</li>
<li>Call our own method that adds all services to that service collection (the same method used during normal startup);</li>
<li>Find all controllers through reflection, and try to construct them the same way MVC does - by getting dependent services from the DI container.</li>
</ol>

<p>So my question is:</p>

<ul>
<li>Does this approach make sense?</li>
<li>Is there an example somewhere that I could use?</li>
<li>Failing an example, how would I achieve 1) and 3) ?</li>
</ul>
",https://stackoverflow.com/questions/53493452/unit-test-to-ensure-all-required-services-are-added-to-the-net-core-di-containe,"['asp.net-core', 'dependency-injection']",335,False,1,0
Keycloak auth for picketlink old app,"<p>I need some help from community! 😊</p>

<p>My old applications are running on Jboss 5 and 6, using Java with Hibernate and Struts or Seam.
The application running on Jboss 6 are SPs of the IDP that is running on Jboss 5.
The users and roles are inside a database and with a specific query, the roles are returned and a SAML response is sent from IDP to SPs.</p>

<p>Everything is done with JAAS and Picketlink 2.5.</p>

<p>We want to move to Keycloak 3 and in fact I was able to replace everything inside the application, but since the applications are huge, I do not have time to do all together mainly due to needed regression testing time.</p>

<p>New applications come in React, protected with Keycloak and JWT.</p>

<p>So, imagine the scenario where I am logged with picketlink and SAML and want to access an new React application.
Since react application is protected with Keycloak server, it will push the user into Keycloak login server page.</p>

<p>How can I avoid it?
I was planning to make some code on server side ti authenticate into Keycloak server (with an authentication endpoint is available) and get the tokens from response and send it back to the client, before client gets the react app in fact.</p>
",https://stackoverflow.com/questions/51822667/keycloak-auth-for-picketlink-old-app,"['java', 'openid-connect', 'keycloak', 'picketlink']",335,False,1,0
How do I determine what is different between two different xlsx versions of the same worksheet?,"<p>I apologize in advance if my question seems somewhat vague (if only I could attach a file that would be so much better!)</p>

<p>I use TestComplete for regression testing, part of which is .rdl-type reports in our software being exported in the .xls format and compared to a previously saved copy.</p>

<p>A newer version of the software will export the file in the .xlsx format, and pretesting this in TestComplete is causing the following issue:  The .xlsx file opens just fine using Microsoft Excel, but the following in TestComplete fails to open it:</p>

<p>DDT.ExcelDriver(strSourceSpreadsheet, strSheet, True)</p>

<p>However, if I open the file with Microsoft Excel and re-save it (making no changes), then the above line of code works just fine.</p>

<p>So the next thing I did was to change the .xlsx extension on the before Excel and after Excel versions to .zip, and then tried comparing the two collections of files.</p>

<p>The re-saved version is almost twice as big as the original one, has additional files, and all the common files are full of differences.  How to I even begin trying to get to the bottom of this?  Has anyone experienced something similar?</p>

<p>Thanks,</p>

<p>PKK</p>

<p>UPDATE:  Of two different reporting formats, the one can be read just fine by the call to DDT.ExcelDriver(...) in TestComplete.  It seems that the problem only comes up with .xlsx files created by MS Report Viewer: 12.0, I think.</p>
",https://stackoverflow.com/questions/49700362/how-do-i-determine-what-is-different-between-two-different-xlsx-versions-of-the,"['excel', 'reportviewer', 'xlsx', 'testcomplete']",420,False,0,1
MarkLogic : Design question on Query Options Vs Transform,"<p>Our team creates a bunch of custom REST APIs (v1/resources/...) and expose them as enterprise services to other stakeholders, who do not need to know anything about MarkLogic. However, our team is responsible for creating, enhancing and maintaining the server-side scripting (we use JavaScript) within MarkLogic.</p>

<p>While creating custom REST APIs, our current design to meet the search requirements is to start with a Query Options, incorporate as many requirements in Query options, and for any requirements that could not be met by Query Options (for example, sorting within a document, complex XPath, merge with other documents etc.), code within the Java Script extension program (technically not a transform but conceptually similar to a transform). </p>

<p>With the limitations in Query options, increasingly, most of our logic is going into the Javascript extension programs and the query options seem to be just a maintenance overhead. Do we really need to maintain a query options file for every REST extension, while the transforms offer much powerful functionality? Can I get rid of Query options and just use server side Java Script code (conceptually, similar to transforms)? Initially, our thought was that Query options is configuration based and hence changing query options is not exactly a code change, however, based on our experience, we realized that changing query options also involves deployment, regression testing and all other activities. Hence I do not see any specific advantage of query options, in our case (creating custom REST APIs).</p>

<p>Design gurus, please suggest!</p>
",https://stackoverflow.com/questions/53436604/marklogic-design-question-on-query-options-vs-transform,"['marklogic-9', 'marklogic-dhf']",20,False,0,1
Faker fouling VRT how can I run VRT tests with same random data so a visual diff is not found,"<p>I use faker in many projects.  Recently I have been introduced to VRT (visual regression testing)  this process takes a snapshot of the site before a deploy and then one immediately after a deploy and alerts the user to any changes in layout.  I am the sole FED dev for a brand and need to be able to repeat the random results from faker for the second time the VRT process runs.  If I do not the VRT process is useless because I get back too many fails to test them all.</p>

<p>Does anyone know a way I can continue to use faker for ongoing dev but somehow capture the random seed for a render, keep it and re-run it for the second VRT test?  So all the text will display the same way the second time.  We use Jenkins.</p>

<p>Perhaps there is a way to call faker that will pass a specific random number so we can use jenkins to run a build that passes a unique the random number?  So we would have ""yarn run VRT-compile"" instead of ""yarn run compile"" and ""yarn run VRT-compile"" would pass in the same random number.  How would I do this?</p>

<p>So here is what we found out: As it turns out utilizing jenkins we were able to add the custom php file for handling the faker seed variable and add/remove it to the project before running yarn compile only for the builds we wanted it for. We submitted a PR to the faker plugin created by PatternLab our front end templating system for them to add this capability to the plugin natively but did not hear back yet. </p>
",https://stackoverflow.com/questions/52408091/faker-fouling-vrt-how-can-i-run-vrt-tests-with-same-random-data-so-a-visual-diff,"['php', 'jenkins', 'faker']",33,False,0,0
ExtJS: Override all AJAX calls in production build,"<p>What I'm trying to do is override all AJAX requests, including AJAX proxies, so what I created was an override for Ext.data.Connection. In development mode, this works like a charm, but in a production build, things get a little weird.</p>

<p>The reason why things get weird is because we're doing something that ""splits"" the build (<a href=""https://stackoverflow.com/a/45122418/1253609"">link here</a>). Meaning, we put all of the framework code into its own file, then have ""app.js,"" which is essentially what we use for booting our application, and ""viewport.js,"" which is the actual application after the booting succeeds. We do this because in ""app.js,"" we have an auth call which makes sure the user is valid, and if they are, then we load ""viewport.js.""</p>

<p>I think the problem with this is, because we're overriding such a core piece of functionality, it doesn't actually get overridden until app.js loads, which, at that point, Ext.Ajax--a singleton of the overridden class Ext.data.Connection--has already been created, and we lose out on overriding that. It looks like the override is included in app.js, so this assumption would make sense.</p>

<p>I think what needs to happen is that the build.xml needs to include this override in the framework.js file, but I really don't know how to do that... I've never dealt with Ant, so I'm not even sure where I would start. If someone could point me in the right direction, that'd be super helpful. This is what the build.xml looks like right now (see begin custom addition comment for where we added the split code):</p>

<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;
&lt;project name=""NewApp"" default="".help""&gt;

    &lt;!-- Find and load Sencha Cmd ant tasks --&gt;
    &lt;script language=""javascript""&gt;
        &lt;![CDATA[
            var dir = project.getProperty(""basedir""),
                cmdDir = project.getProperty(""cmd.dir""),
                cmdLoaded = project.getReference(""senchaloader"");

            if (!cmdLoaded) {
                function echo(message, file) {
                    var e = project.createTask(""echo"");
                    e.setMessage(message);
                    if (file) {
                        e.setFile(file);
                    }
                    e.execute();
                };

                if (!cmdDir) {

                    function exec(args) {
                        var process = java.lang.Runtime.getRuntime().exec(args),
                            input = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())),
                            headerFound = false,
                            line;

                        while (line = input.readLine()) {
                            line = line + '';
                            java.lang.System.out.println(line);
                            if (line.indexOf(""Sencha Cmd"") &gt; -1) {
                                headerFound = true;
                            }
                            else if (headerFound &amp;&amp; !cmdDir) {
                                cmdDir = line;
                                project.setProperty(""cmd.dir"", cmdDir);
                            }
                        }
                        process.waitFor();
                        return !!cmdDir;
                    }

                    if (!exec([""sencha"", ""which""])) {
                        var tmpFile = ""tmp.sh"";
                        echo(""source ~/.bash_profile; sencha "" + whichArgs.join("" ""), tmpFile);
                        exec([""/bin/sh"", tmpFile]);
                        new java.io.File(tmpFile)['delete']();
                    }
                }
            }

            if (cmdDir &amp;&amp; !project.getTargets().containsKey(""init-cmd"")) {
                var importDir = project.getProperty(""build-impl.dir"") ||
                                (cmdDir + ""/ant/build/app/build-impl.xml"");
                var importTask = project.createTask(""import"");

                importTask.setOwningTarget(self.getOwningTarget());
                importTask.setLocation(self.getLocation());
                importTask.setFile(importDir);
                importTask.execute();
            }
        ]]&gt;
    &lt;/script&gt;

    &lt;!--
    The following targets can be provided to inject logic before and/or after key steps
    of the build process:

        The ""init-local"" target is used to initialize properties that may be personalized
        for the local machine.

            &lt;target name=""-before-init-local""/&gt;
            &lt;target name=""-after-init-local""/&gt;

        The ""clean"" target is used to clean build output from the build.dir.

            &lt;target name=""-before-clean""/&gt;
            &lt;target name=""-after-clean""/&gt;

        The general ""init"" target is used to initialize all other properties, including
        those provided by Sencha Cmd.

            &lt;target name=""-before-init""/&gt;
            &lt;target name=""-after-init""/&gt;

        The ""page"" target performs the call to Sencha Cmd to build the 'all-classes.js' file.

            &lt;target name=""-before-page""/&gt;
            &lt;target name=""-after-page""/&gt;

        The ""build"" target performs the call to Sencha Cmd to build the application.

            &lt;target name=""-before-build""/&gt;
            &lt;target name=""-after-build""/&gt;
    --&gt;
    &lt;!-- BEGIN CUSTOM ADDITION TO BUILD.XML --&gt;
    &lt;target name=""-after-js""&gt;
        &lt;!-- The following is derived from the compile-js target in
             .sencha/app/js-impl.xml. Compile the viewport and all of its
             dependencies into viewport.js. Include in the framework
             dependencies in the framework file. --&gt;
        &lt;x-compile refid=""${compiler.ref.id}""&gt;
            &lt;![CDATA[
            union
              -r
              -class=${app.name}.view.main.Main
            and
            save
              viewport
            and
            intersect
              -set=viewport,allframework
            and
            include
              -set=frameworkdeps
            and
            save
              frameworkdeps
            and
            include
              -tag=Ext.cmd.derive
            and
            concat
              -remove-text-references=${build.remove.references}
              -optimize-string-references=${build.optimize.string.references}
              -remove-requirement-nodes=${build.remove.requirement.nodes}
              ${build.compression}
              -out=${build.framework.file}
              ${build.concat.options}
            and
            restore
              viewport
            and
            exclude
              -set=frameworkdeps
            and
            exclude
              -set=page
            and
            exclude
              -tag=Ext.cmd.derive,derive
            and
            concat
              -remove-text-references=${build.remove.references}
              -optimize-string-references=${build.optimize.string.references}
              -remove-requirement-nodes=${build.remove.requirement.nodes}
              ${build.compression}
              -out=${build.out.base.path}/${build.id}/viewport.js
              ${build.concat.options}
            ]]&gt;
        &lt;/x-compile&gt;

        &lt;!-- Concatenate the file that sets the main view. --&gt;
        &lt;concat destfile=""${build.out.base.path}/${build.id}/viewport.js"" append=""true""&gt;
            &lt;fileset file=""classic/viewport.js""/&gt;
        &lt;/concat&gt;
    &lt;/target&gt;

    &lt;target name=""-before-sass""&gt;
        &lt;!-- The viewport is not explicitly required by the application,
             however, its SCSS dependencies need to be included. Unfortunately,
             the property required to filter the output, sass.name.filter, is
             declared as local and cannot be overridden. Use the development
             configuration instead. --&gt;
        &lt;property name=""build.include.all.scss"" value=""true""/&gt;
    &lt;/target&gt;

&lt;/project&gt;
</code></pre>

<p>To recap, running <strong>sencha app watch</strong> and loading the page will show the listeners for the Ext.Ajax singleton, but running <strong>sencha app build production</strong> and loading the page will show no listeners. And no, I do not wish to create my own version of Ext.Ajax or my own data proxy... I realize that's probably the right approach, but there is a lot of code where I'd have to replace that, and that would be a whole lot of regression testing that I currently don't have time for.</p>
",https://stackoverflow.com/questions/48309545/extjs-override-all-ajax-calls-in-production-build,"['javascript', 'ajax', 'extjs', 'ant', 'extjs6']",291,False,0,1
