title,body,link,tags,view_count,is_answered,score,answer_count
How to configure visual regression testing using Loki for Angular and Web components in Storybook,"<p>We have a design system with the core components built on Stencil and cross-compiled across React and Angular frameworks. Ideally we have all the components in <strong>React, Angular and Web-components</strong>. We use storybook as Component explorer. Now that we have a need for visual regression testing, I have been going through many visual regression test tools that there and found <strong>Loki</strong> to be most suitable.</p>
<p>I was able to successfully configure <strong>Loki for React</strong> components alone by passing the command line arguments</p>
<pre><code>yarn loki test -- --port 6003
</code></pre>
<p>where my react components in storybook run on port 6003. Angular and web components in storybook run on ports 6004 and 6002 respectively.</p>
<p>The <a href=""https://loki.js.org/getting-started.html"" rel=""nofollow noreferrer"">documentation for Loki</a>, has configurations for react and native react only. Not sure if I have missed for the rest.</p>
<p>But I am clueless about how this has to be done for Angular and Web-components. Any leads on this is much appreciated!</p>
",https://stackoverflow.com/questions/75142222/how-to-configure-visual-regression-testing-using-loki-for-angular-and-web-compon,"['automated-tests', 'storybook', 'lokijs', 'snapshot-testing', 'visual-testing']",63,False,1,0
Creating a mock device from a real device and use that mock device for regression testing,"<p>is there any way to create a mock device from real device ? I mean the mock device should have all the configurations of the real device and we should be able to read and write to the mock device. The purpose here is when ever the real devices are down we can still be able to test our features of an application using a mock device.</p>
<p>I tried with pyATS framework to create a mock device but the mock device is not writable or we can not configure something to the mock device like we do in the physical devices. Also i am not able to ssh the mock device from nso. So i am expecting how to ssh the mock device from nso, how to assign an ip and port to the device and how we can use the mock device for write purpose.</p>
",https://stackoverflow.com/questions/75916193/creating-a-mock-device-from-a-real-device-and-use-that-mock-device-for-regressio,"['testing', 'mocking', 'automated-tests', 'router']",31,False,0,0
I&#39;m running Percy visual regression testing through the Cypress.IO testing framework but the font in my Percy screenshot aren&#39;t correct,"<p>The fonts are displaying correctly in the Browser but the Percy snapshot is using the incorrect fonts. Not entirely sure what info will help here but here's a snippet of the Cypress + Percy test:</p>
<pre><code>describe(&quot;Article page&quot;, () =&gt; {
  it(&quot;passes&quot;, () =&gt; {
    cy.visit(&quot;/articles/augustas-story-being-youth-advisor-0&quot;);
    cy.document().its(&quot;fonts.status&quot;).should(&quot;equal&quot;, &quot;loaded&quot;);
    cy.wait(2000);
    cy.percySnapshot();
  });
});
</code></pre>
<p>And my fonts like so:</p>
<pre><code>@font-face {
  font-family: 'Helvetica LT Std Bold';
  src: url('/themes/custom/planuk/fonts/HelveticaLTStd-Bold.woff2') format('woff2'),
  url('/themes/custom/planuk/fonts/HelveticaLTStd-Bold.woff') format('woff'),
  url('/themes/custom/planuk/fonts/HelveticaLTStd-Bold.ttf') format('truetype'),
  url('/themes/custom/planuk/fonts/HelveticaLTStd-Bold.svg#HelveticaLTStd-Bold') format('svg');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}
</code></pre>
",https://stackoverflow.com/questions/75296962/im-running-percy-visual-regression-testing-through-the-cypress-io-testing-frame,"['cypress', 'percy']",60,False,1,0
Jenkins Pipeline to Excel Spreadsheet,"<p>I have a pipeline which runs sql counts everyday as part of regression testing, I would like to be able to export the results of each build into an excel document where the results can be stored and compared, is this possible?</p>
<p>Thanks in advance</p>
",https://stackoverflow.com/questions/75434698/jenkins-pipeline-to-excel-spreadsheet,"['sql', 'excel', 'jenkins', 'jenkins-pipeline']",144,False,0,0
"I have this issue when running a playwright test on jenkins &gt;&gt; Error: EACCES: permission denied, rmdir","<h3>Hey, could somebody please tell me what to do. I have this kind of issue when trying to run a test in jenkins. I don't know why this appears, but just with api tests it runs correctly. When using mi terminal in VS code, everything works fine, but when using jenkins, and not running api tests, I got this error.</h3>
<p>Started by user Stefano Isaac Falconi Caro
Running as SYSTEM
Building in workspace /home/mrsdes-002/Documents/PlaywrightCourse
[PlaywrightCourse] $ /bin/sh -xe /tmp/jenkins14231184374416723344.sh</p>
<ul>
<li>npm run tests:chrome</li>
</ul>
<blockquote>
<p>playwrightcourse@1.0.0 tests:chrome
playwright test --config=playwright.config.ts --project=Chromium --reporter=list</p>
</blockquote>
<p>Running 4 tests using 3 workers</p>
<p>Error: EACCES: permission denied, rmdir '/home/mrsdes-002/Documents/PlaywrightCourse/test-results'</p>
<p>✘  1 [Chromium] › tests/e2e/e2e-login.spec.ts:28:9 › Login / Logout Flow › Positive Scenario for login + logout (17ms)
✘  2 [Chromium] › tests/e2e/e2e-login.spec.ts:18:9 › Login / Logout Flow › Negative Scenario for Login (16ms)
✘  3 [Chromium] › tests/visual/visual.spec.ts:4:9 › Visual Regression testing › Full Page Snapshot (13ms)
✘  4 [Chromium] › tests/visual/visual.spec.ts:9:9 › Visual Regression testing › Single element Snapshot (16ms)</p>
<ol>
<li><p>[Chromium] › tests/e2e/e2e-login.spec.ts:18:9 › Login / Logout Flow › Negative Scenario for Login</p>
<p>browserType.launch: Executable doesn't exist at /var/lib/jenkins/.cache/ms-playwright/chromium-1040/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ &lt;3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝</p>
</li>
<li><p>[Chromium] › tests/e2e/e2e-login.spec.ts:28:9 › Login / Logout Flow › Positive Scenario for login + logout</p>
<p>browserType.launch: Executable doesn't exist at /var/lib/jenkins/.cache/ms-playwright/chromium-1040/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ &lt;3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝</p>
</li>
<li><p>[Chromium] › tests/visual/visual.spec.ts:4:9 › Visual Regression testing › Full Page Snapshot =</p>
<p>browserType.launch: Executable doesn't exist at /var/lib/jenkins/.cache/ms-playwright/chromium-1040/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ &lt;3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝</p>
</li>
<li><p>[Chromium] › tests/visual/visual.spec.ts:9:9 › Visual Regression testing › Single element Snapshot</p>
<p>browserType.launch: Executable doesn't exist at /var/lib/jenkins/.cache/ms-playwright/chromium-1040/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ &lt;3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝</p>
</li>
</ol>
<p>4 failed
[Chromium] › tests/e2e/e2e-login.spec.ts:18:9 › Login / Logout Flow › Negative Scenario for Login
[Chromium] › tests/e2e/e2e-login.spec.ts:28:9 › Login / Logout Flow › Positive Scenario for login + logout
[Chromium] › tests/visual/visual.spec.ts:4:9 › Visual Regression testing › Full Page Snapshot ==
[Chromium] › tests/visual/visual.spec.ts:9:9 › Visual Regression testing › Single element Snapshot
1 error was not a part of any test, see above for details
Build step 'Execute shell' marked build as failure
Finished: FAILURE</p>
<p>I've tried installing node again and again, and changing jenkins configuration, but it still does not approve the test when running it in jenkins.</p>
<p>I expect to solve this issue, due to I am doing a playwright course, but this got me off right now.</p>
",https://stackoverflow.com/questions/75214943/i-have-this-issue-when-running-a-playwright-test-on-jenkins-error-eacces-pe,"['node.js', 'jenkins', 'testing', 'playwright']",347,False,1,0
how to combine shinytest2 and ggplot2 output if sometimes expect a message instead of a plot,"<p>my app returns a ggplot  - or -  a message to the user why the plot isn't generated<br />
the mesage is created with <code>validate(need())</code><br />
I haven't been able to figure out how to make this work with shinytest2<br />
here's the example from <a href=""https://rstudio.github.io/shinytest2/articles/robust.html"" rel=""nofollow noreferrer"">Robust testing</a> updated to show what I'm trying to do</p>
<p>app file:</p>
<pre><code># initial example from
#   https://rstudio.github.io/shinytest2/articles/robust.html
# removed depreciated aes_string()

library(shiny)
library(ggplot2)
ui &lt;- fluidPage(
  numericInput(&quot;n&quot;, &quot;Number of rows&quot;, 10, 1, nrow(cars)),
  plotOutput(&quot;plot&quot;)
)
server &lt;- function(input, output) {
  dt &lt;- reactive({
    head(cars, input$n)
  })
  plot_obj &lt;- reactive({
    validate(need(input$n &gt; 0, message = &quot;n must be strictly positive&quot;))
    ggplot(dt(), aes(speed, dist)) + geom_point()
  })

  output$plot &lt;- renderPlot({
    plot_obj()
  })

  exportTestValues(
    dt = dt(),
    plot_obj = plot_obj()
  )
}
plot_app &lt;- shinyApp(ui = ui, server = server)
plot_app
</code></pre>
<p>test file:</p>
<pre><code># File: tests/testthat/test-export.R
library(shinytest2)

test_that(&quot;`export`ed `plot_obj` is updated by `n`&quot;, {
  skip_if_not_installed(&quot;vdiffr&quot;)

  app &lt;- AppDriver$new(variant = platform_variant())

  expect_n_and_plot &lt;- function(n) {
    # Verify `n` input equals `n`
    n_val &lt;- app$get_value(input = &quot;n&quot;)
    expect_equal(n_val, n, expected.label = n)
    # Verify `dt()` data is first `n` lines of `cars`
    dt &lt;- app$get_value(export = &quot;dt&quot;)
    expect_equal(dt, head(cars, n), expected.label = paste0(&quot;head(cars, &quot;, n, &quot;)&quot;))

    # Verify `plot_obj()` data is `dt()`
    plot_obj &lt;- app$get_value(export = &quot;plot_obj&quot;)
    expect_equal(plot_obj$data, dt, info = paste0(&quot;n = &quot;, n))
    # Verify `plot_obj()` is consistent
    vdiffr::expect_doppelganger(paste0(&quot;cars-points-&quot;, n), plot_obj)
  }

  expect_n_and_plot(10)

  # Update `n` to 20
  app$set_inputs(n = 20)
  expect_n_and_plot(20)

  # Update `n` to -1, expect message
  app$set_inputs(n = -1)
  expect_n_and_plot(-1)
})
</code></pre>
<p>ideally the regression testing would capture the returned message like it would for a standard output<br />
thanks for thinking about this</p>
",https://stackoverflow.com/questions/75959533/how-to-combine-shinytest2-and-ggplot2-output-if-sometimes-expect-a-message-inste,"['r', 'ggplot2', 'shiny', 'shinytest']",26,False,1,1
How do I make z3 float solution not random,"<p>I am currently doing regression testing so I need the fixed results rather than random ones. I have tried all the methods including setting the random seed to 0, set_option('smt.arith.random_initial_value',False) and others. But nothing changes. The float solutions still seem random.
Here is the simple example:</p>
<pre class=""lang-py prettyprint-override""><code>from z3 import *
set_option('smt.arith.random_initial_value',False)

set_option('smt.random_seed', 0)

def test_short_expont():
    float_type = Float32()
    solver = Solver()
    solver.set(&quot;randomize&quot;,False)
    fp_5 = FP('fp_5',float_type)
    fp_10 = FP('fp_10',float_type)
    
    solver.add( fpEQ(fpAdd(RNE(), fp_5, fp_5),fp_10) )
    #solver.add( fpEQ(fpMul(RNE(), fp_5, fp_10),fp_5) )
    if solver.check() == sat:
        model = solver.model()
        return model
    else:
        return
    
</code></pre>
<p>I expects the solutions maintain same but every time I run there comes different results.</p>
<pre class=""lang-py prettyprint-override""><code>[fp_10 = 1.3322999477386474609375*(2**-112),
 fp_5 = 1.3322999477386474609375*(2**-113)]

[fp_10 = -1.66065156459808349609375*(2**1),
 fp_5 = -1.66065156459808349609375]

[fp_10 = 1.2059905529022216796875*(2**-126),
 fp_5 = 0.60299527645111083984375*(2**-126)]
</code></pre>
<p>It seems that fixing the random  seed is effective for the int solutions, but don't have influence on the float solutions.</p>
<p>Is there any method to make the float solution not random?</p>
",https://stackoverflow.com/questions/76031510/how-do-i-make-z3-float-solution-not-random,"['z3', 'z3py', 'formal-verification', 'smt-lib']",52,True,0,1
How to configure visual regression testing using Loki for Angular and Web components in Storybook,"<p>We have a design system with the core components built on Stencil and cross-compiled across React and Angular frameworks. Ideally we have all the components in <strong>React, Angular and Web-components</strong>. We use storybook as Component explorer. Now that we have a need for visual regression testing, I have been going through many visual regression test tools that there and found <strong>Loki</strong> to be most suitable.</p>
<p>I was able to successfully configure <strong>Loki for React</strong> components alone by passing the command line arguments</p>
<pre><code>yarn loki test -- --port 6003
</code></pre>
<p>where my react components in storybook run on port 6003. Angular and web components in storybook run on ports 6004 and 6002 respectively.</p>
<p>The <a href=""https://loki.js.org/getting-started.html"" rel=""nofollow noreferrer"">documentation for Loki</a>, has configurations for react and native react only. Not sure if I have missed for the rest.</p>
<p>But I am clueless about how this has to be done for Angular and Web-components. Any leads on this is much appreciated!</p>
",https://stackoverflow.com/questions/75142222/how-to-configure-visual-regression-testing-using-loki-for-angular-and-web-compon,"['automated-tests', 'storybook', 'lokijs', 'snapshot-testing', 'visual-testing']",63,False,1,0
Detox giving a false positive on `expect(...)toBeVisible()`,"<p>I'm having some trouble understanding why detox is telling me elements are visible when they are not to the naked eye.</p>
<p>Our application has testIDs attached to basically any element that we would write tests against. <a href=""https://i.stack.imgur.com/lrsA4.png"" rel=""nofollow noreferrer"">Here is an example of a screen that we would display to the user</a></p>
<p><a href=""https://i.stack.imgur.com/YY5im.png"" rel=""nofollow noreferrer"">And this is what it looks like when there is no text</a></p>
<p>Detox passes in both scenarios on the visibility of the element.</p>
<p>We did realize that we had a flex in the view that caused the text to wrap incorrectly, but it is concerning that detox tells me the element is visible when it clearly isn't.</p>
<p>I tried updating the visibility threshold to 100 in <code>toBeVisible</code> as well as using <code>getAttributes</code> and asserting the visible attribute was true.</p>
<p>We could employ visual regression testing but that feels cumbersome and unnecessary, is there something we're missing to resolve this?</p>
",https://stackoverflow.com/questions/76210052/detox-giving-a-false-positive-on-expect-tobevisible,['detox'],19,False,0,0
How can I prevent cached modules/variables when using runpy in pytest tests?,"<p>(Preface: This is a toy example to illustrate an issue that involves much larger scripts that use a ton of modules/libraries that I don't have control over)</p>
<p>Given these files:</p>
<pre class=""lang-py prettyprint-override""><code># bar.py
barvar = []

def barfun():
    barvar.append(1)


# foo.py
import bar

foovar = []
def foofun():
    foovar.append(1)

if __name__ == '__main__':

    foofun()
    bar.barfun()
    foovar.append(2)
    bar.barvar.append(2)

    print(f'{foovar    =}')
    print(f'{bar.barvar=}')
    
# test_foo.py
import sys
import os
import pytest
import runpy

sys.path.insert(0,os.getcwd()) # so that &quot;import bar&quot; in foo.py works

@pytest.mark.parametrize('execution_number', range(5))
def test1(execution_number):
    print(f'\n{execution_number=}\n')
    sys.argv=[os.path.join(os.getcwd(),'foo.py')]
    runpy.run_path('foo.py',run_name=&quot;__main__&quot;)
</code></pre>
<p>If I now run <code>pytest test_foo.py -s</code> I will get:</p>
<pre><code>========================================================================
platform win32 -- Python 3.10.8, pytest-7.2.0, pluggy-1.0.0
rootdir: C:\Temp
plugins: anyio-3.6.2
collected 5 items

test_foo.py
execution_number=0

foovar    =[1, 2]
bar.barvar=[1, 2]
.
execution_number=1

foovar    =[1, 2]
bar.barvar=[1, 2, 1, 2]
.
execution_number=2

foovar    =[1, 2]
bar.barvar=[1, 2, 1, 2, 1, 2]
.
execution_number=3

foovar    =[1, 2]
bar.barvar=[1, 2, 1, 2, 1, 2, 1, 2]
.
execution_number=4

foovar    =[1, 2]
bar.barvar=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
.

========================================================================
</code></pre>
<p>So <code>barvar</code> is remembering its previous content. This is obviously detrimental to testing.</p>
<p><strong>Can it be prevented while still using <code>runpy</code>?</strong></p>
<p>Understandably, python <a href=""https://docs.python.org/3/library/runpy.html"" rel=""nofollow noreferrer"">docs</a> warn about <code>runpy</code> side effects:</p>
<blockquote>
<p>Note that this is not a sandbox module - all code is executed in the current process, and any side effects (such as cached imports of other modules) will remain in place after the functions have returned.</p>
</blockquote>
<p><strong>If this is tricky or too complicated to do reliably, are there alternatives?</strong> I am looking for the convenience of testing scripts that take arguments and produce stuff (usually files). My typical <code>pytest</code> test script sets up arguments via <code>sys.argv</code> then runs via <code>runpy</code> the target script (very large programs with lots of imports), then validates the generated files (e.g., compare against a baseline for regression testing). There are many invocations within a single test run; hence the need for a clean slate.</p>
<p><code>subprocess.run(['python.exe', 'script.py', *arglist])</code> is another option I can think of.</p>
<p>Thanks.</p>
",https://stackoverflow.com/questions/75599488/how-can-i-prevent-cached-modules-variables-when-using-runpy-in-pytest-tests,"['python', 'unit-testing', 'testing', 'pytest', 'runpy']",64,True,1,2
In a feature release CI/CD pipeline when is source branch re-synced with accepted features?,"<p>Let's say the <code>development</code>  branch is expected to be the source of truth. Each new feature should branch out from the <code>development</code> branch.</p>
<p>In the starting of a new feature a branch should be created from the <code>development</code> branch.
The development of the feature is then done in a local enviorment, where unittests are also performed.</p>
<p>Once the feature is developed and ready for for User Acceptance Tests (UAT), a pull request is first opened against the <code>developement</code> branch. This performs regression testing and if the tests pass it merges the feature into the <code>development</code> branch and opens a pull request against the <code>UAT</code> branch where the user can test before deployment to production.</p>
<p>If the user is satisfied with the testing the pull request can be closed and merged into the <code>UAT</code> branch. Once the release is ready a pull request is opened against the <code>master</code> branch, and merged once the feature is to be released.</p>
<p>My question is, once the feature is merged onto the <code>UAT</code> branch, the <code>development</code> branch needs to be re synced to reflect the accepted feature. In what fashion would this be done, would you pull the <code>UAT</code> branch from <code>development</code> or merge the <code>UAT</code> on top of the <code>development</code>?</p>
<p>Once that action has been performed, each developer would have to rebase their feature branches from the development branch to incorporate the latest changes.</p>
",https://stackoverflow.com/questions/75395941/in-a-feature-release-ci-cd-pipeline-when-is-source-branch-re-synced-with-accepte,"['git', 'github', 'cicd']",11,False,0,0
Fill a FileDialog from another macro,"<p>Edit : Sorry i forgot to mention that is VBA for Excel</p>
<p>First time i post on this sub reddit. I would like to something very simple, yet I have no heckin idea how to do it.</p>
<p>Let me give you a bit of context : In my company we have a standard model tool, which uses a standard excel file as input.</p>
<p>When you want to update your inputs from an old template, you download a standard file from a platform, and use a sub that doesn't take any arguments (called &quot;upgrade engine&quot;). Wen you call Upgrade engine, there is a file dialog tab that opens, and helps you select the source file you want to upgrade.</p>
<p>I am in a testing team for the standard model and i have to create a lot of templatse for each new release of the model for non regression testing purpose. So i would like to automatize the process. I cannot , and this is the important detail here, change the code of the standard template.</p>
<p>So i created a kind of masterfile with all my non regression test use cases, their address etc to update them one by one.</p>
<p>Here is my current code:</p>
<pre><code>Public gParamTab As Variant
Public gHypTab As Variant

Public gSourcefolder As String
Public gBlankFolder As String
Public gTgtfolder As String

Public Const gParamTabColUseCase As Byte = 1
Public Const gParamTabColTTtgt As Byte = 2
Public Const gParamTabColTTSource As Byte = 3
Public Const gParamTabColFlagRetrieve As Byte = 4
Public Const gParamTabColTTCase As Byte = 5
Public Const gParamTabColFlagUpgrade As Byte = 6

Public Const gBlankTTName As String = &quot;Table_Template_MVP_case&quot;

Public Const gExtension As String = &quot;.xlsb&quot;




Sub init()
gParamTab = Sheets(&quot;Parameters&quot;).Range(&quot;gParamTab&quot;)
gHypTab = Sheets(&quot;NDD HYP&quot;).Range(&quot;gHypTab&quot;)

gSourcefolder = Sheets(&quot;Parameters&quot;).Range(&quot;gSourcefolder&quot;)
gTgtfolder = Sheets(&quot;Parameters&quot;).Range(&quot;gTgtfolder&quot;)
gBlankFolder = Sheets(&quot;Parameters&quot;).Range(&quot;gBlankFolder&quot;)

End Sub
Sub updateTT()

Call init

Dim lFullname_blank As String, lFullname_source As String, lFullname_tgt As String
Dim lGlobalrange As Variant
Dim lGlobaltable() As Variant
Dim lBlankTT As Workbook
Dim lLastRow As Long
Dim lSearchedVariable As Variant
Dim lBlankTTupgradeengine As String
lcol = 2

For lUsecase = 2 To UBound(gParamTab, 1)
    If gParamTab(lUsecase, gParamTabColFlagUpgrade) = 1 Then
     
        lFullname_blank = gBlankFolder &amp; &quot;\&quot; &amp; gBlankTTName &amp; gParamTab(lUsecase, gParamTabColTTCase) &amp; gExtension
        lFullname_source = gSourcefolder &amp; &quot;\&quot; &amp; gParamTab(lUsecase, gParamTabColTTSource) &amp; gExtension
        lFullname_tgt = gTgtfolder &amp; &quot;\&quot; &amp; gParamTab(lUsecase, gParamTabColTTtgt) &amp; gExtension
        
        Set lBlankTT = Workbooks.Open(lFullname_blank)
        
        lBlankTTupgradeengine = gBlankTTName &amp; gParamTab(lUsecase, gParamTabColTTCase) &amp; gExtension &amp; &quot;!UpgradeEngine.UpgradeEngine&quot;
        
        Application.Run lBlankTTupgradeengine
        
    End If
Next
    


End Sub
</code></pre>
<p>So i come the main issue, how can I, from another macro, after the statement &quot;Application.Run lBlankTTupgradeengine&quot; , the upgrade engine macro starts, and calls the following function embedded in the &quot;BlankTT&quot; :</p>
<pre><code>Sub UpgradeEngine()


    Set wkb_target = ThisWorkbook
    Set wkb_source = macros_Fn.Open_wkb()

[...]


</code></pre>
<pre><code>Function Open_wkb() As Workbook

    Dim fileName As Variant

    With Application.FileDialog(msoFileDialogFilePicker)
  
        ' Makes sure the user can select only one file
        .AllowMultiSelect = False
        
        ' Filter to just keep the relevants types of files
        .filters.Add &quot;Excel Files&quot;, &quot;*.xlsm; *.xlsb&quot;, 1

        .Show
        
        ' Extact path
        If .SelectedItems.Count &gt; 0 Then
            fileName = .SelectedItems.Item(1)
        Else
            End
        End If
        
    End With
                  
    If (fileName &lt;&gt; False) Then
        Set Open_wkb = Workbooks.Open(fileName:=fileName, IgnoreReadOnlyRecommended:=False, Editable:=False, ReadOnly:=True, UpdateLinks:=False)
    Else
        MsgBox &quot;This file is already open. Please close it before launching the function.&quot;
        End
    End If
        
End Function
</code></pre>
<p>This function opens as I said before, a dialog box with a brows button to select the excel spreadsheet to use as ssource.</p>
<p>My question is, how can i fill automatically this Filedialog from my code, without changing the code of the standard excel file?</p>
<p>Thanks a lot for your help!</p>
<p>I tried to search everywhere but i did not find anything about this situation.</p>
<p>I'm trying to move a copy of the upgrade engine, but with an argument in the sub instead of the filedialog but the macro is too complex ..</p>
",https://stackoverflow.com/questions/75499307/fill-a-filedialog-from-another-macro,"['excel', 'vba', 'filedialog']",40,False,0,2
