title,body,link,tags,view_count,is_answered,score,answer_count
Xamarin UI Testing,"<p>I would like to add UnitTest into my Xamarin app, I get the splash screen displaying on the Andriod emulator and then the landing page loads but the next page it seems to closes the app . I have break point around the Platform.Android and that hits but it never hit the end of that method. I added WaitTimes for 5 minutes and I will get the timeout exception </p>

<blockquote>
  <p>Any idea why the app closes ?</p>
</blockquote>

<pre><code>  static class AppManager
{
    private const string ApkPath = @""C:\pathtoapkfile.apk"";

    static IApp app;
    public static IApp App
    {
        get
        {
            if (app == null)
                throw new NullReferenceException(""'AppManager.App' not set. Call 'AppManager.StartApp()' before trying to access it."");
            return app;
        }
    }

    static Platform? platform;
    public static Platform Platform
    {
        get
        {
            if (platform == null)
                throw new NullReferenceException(""'AppManager.Platform' not set."");
            return platform.Value;
        }

        set { platform = value; }
    }

    public static void StartApp()
    {
        if (Platform == Platform.Android)
        {
            app = ConfigureApp
                .Android
                .ApkFile(ApkPath)
                .WaitTimes(new WaitTimes())
                .StartApp(AppDataMode.Clear);
        }

        if (Platform == Platform.iOS)
        {
            app = ConfigureApp
                .iOS
                .StartApp(AppDataMode.Clear);
        }
    }

}
</code></pre>
",https://stackoverflow.com/questions/58242444/xamarin-ui-testing,"['xamarin', 'xamarin.forms', 'ui-testing', 'xamarin-test-cloud']",118,False,0,0
Xcode UI Testing plan,"<p>I would like to implement UI Testing for my app, but I couldn't find anywhere some guides on how to structure the tests, group them or which is the best way to proceed writing the tests - a big flow in a test, or multiple tests for smaller flows.
If you have some resources regarding these topics, any help would be appreciated.</p>

<p>Thank you!</p>
",https://stackoverflow.com/questions/56803682/xcode-ui-testing-plan,"['ios', 'user-interface', 'testing', 'architecture', 'ui-automation']",242,True,1,2
SearchView ui testing android,"<p>i have write code to test my SearchView behavior but failed. standard scenario just i want to insert some query into my searcview and then submit </p>

<p>this is my code</p>

<pre><code>  onView(withId(R.id.search_match))
        .perform(click())


    onView(
        withId(R.id.search_src_text)
    ).perform(replaceText(""Arsenal""), closeSoftKeyboard(), pressKey(KeyEvent.KEYCODE_ENTER)) //failed here
</code></pre>

<p>i got error like this</p>

<pre><code>androidx.test.espresso.PerformException: Error performing 'replace text(Arsenal)' on view 'with id: com.kuhaku.footballmatchschedule:id/search_src_text'.
</code></pre>

<p>my xml code</p>

<pre><code>&lt;androidx.cardview.widget.CardView
    app:cardCornerRadius=""12dp""
    android:layout_marginHorizontal=""8dp""
    app:cardElevation=""8dp""
    android:id=""@+id/card_search""
    app:cardUseCompatPadding=""true""
    app:layout_constraintTop_toTopOf=""parent""
    android:layout_width=""match_parent""
    android:layout_height=""wrap_content""&gt;
    &lt;androidx.appcompat.widget.SearchView
        android:id=""@+id/search_match""
        app:queryHint=""Search Match""
        app:layout_constraintTop_toTopOf=""parent""
        android:layout_width=""match_parent""
        android:layout_height=""wrap_content""/&gt;
&lt;/androidx.cardview.widget.CardView&gt;
</code></pre>
",https://stackoverflow.com/questions/59232866/searchview-ui-testing-android,"['android', 'testing', 'kotlin', 'android-espresso', 'searchview']",785,False,0,2
UI testing of Flutter plugin,"<p>I work on some application that performs a complex rendering using a <code>Mabpox</code> map.</p>

<p>So I made a Flutter plugin that performs drawing. It works fine inside a <code>Flutter</code> app using <code>PlatformView</code>. </p>

<p>The Flutter plugin has a lot of native logic. So I would like to test it by some unit and UI tests. Right now I am interested only in Android test, because work on iOS implementation has not been started yet. However I don't understand how I can do testing for the native part of the Plugin. </p>

<p>What is a correct way of doing such ui and unit tests of the Android code of the plugin?</p>

<p>I initially tried to link that module into android test project and setup all the testing there. However it doesn't work, because of <code>flutter.jar</code> dependency.</p>
",https://stackoverflow.com/questions/54991398/ui-testing-of-flutter-plugin,"['android', 'flutter']",387,False,3,1
Android UI Testing With MVVM,"<p>I use MVVM architecture and Dagger 2 in my application. I have a repository that gets data from servers, and when the data is retrieved ViewModel notifies the LiveData observer, which invokes the <code>updateUI()</code> method from my Activity.</p>

<p>So, when I am testing which views are visible with espresso, I want to wait until the <code>updateUI()</code> gets called. I cannot mock the ViewModel easily since I am using Dagger 2 but aside from that since it is an integration test, I don't want to do it in the first place.</p>

<p><code>Thread.sleep()</code> would be an awful and naive solution for this, since too little waiting time would cause the test to fail, too much of it would cause to the loss of valuable time and it also depends on the testing and network environment!</p>

<p>So what do we do here, what's the optimal solution to this problem?</p>
",https://stackoverflow.com/questions/58359589/android-ui-testing-with-mvvm,"['java', 'android', 'unit-testing', 'testing', 'mvvm']",1033,True,2,1
UI Testing with REST API,"<p>I have one requirement in Automation to test UI and APIs at a time. Get parameters from the UI and pass them to API and get response. </p>

<p>Steps are like:</p>

<ul>
<li>Step 1: Enter text in the search field</li>
<li>Step 2: Click on Search button</li>
<li>step 3: Read text from the search field and pass to the API</li>
<li>Step 4: Get the Response</li>
<li>Step 5: Compare both UI and API response. </li>
</ul>

<p>Is it possible by automation? </p>

<p>Please help me with your suggestions.</p>
",https://stackoverflow.com/questions/59207055/ui-testing-with-rest-api,"['selenium-webdriver', 'automation', 'web-api-testing']",1439,False,0,2
UI Testing in iOS/Swift,"<p>I am pretty new to <em>iOS</em> UITesting. I'm currently writing UITest for my app using <code>XCTest</code>. I was able to test if a <code>UIElement</code> is visible or hidden when a particular button is tapped. But I wanted to test if a certain method is called when a button is tapped. How to do this? Does this come under UI testing?</p>

<p>I also wanted to test the <code>UIElement</code>s visible/hidden only when certain sent events are triggered instead of tap. Can we test sent events like <code>Touch Down</code> or <code>Touch Up Inside</code> of the button? Any help is appreciated. Thanks.</p>
",https://stackoverflow.com/questions/55846184/ui-testing-in-ios-swift,"['ios', 'swift', 'user-interface', 'xctest', 'xcode-ui-testing']",706,True,0,2
UI-Testing Google Maps Marker Icons,"<p>I'm trying to assert in my UI test (using either Espresso or UI Automator) that the markers displayed on the map are assigned the correct icons. So far I'm only able to find markers using UI Automator which gives me back a <code>UiObject</code> which I can't use to fetch back the icon or overlay values. What could be a way to achieve that?</p>
",https://stackoverflow.com/questions/58030450/ui-testing-google-maps-marker-icons,"['android', 'google-maps-android-api-2', 'android-espresso', 'android-uiautomator']",488,False,4,0
NSOpenPanel Breaks UI Testing on macOS,"<p>I'm using Xcode to do UI testing on a sandboxed macOS app that has the <code>com.apple.security.files.user-selected.read-write</code> entitlement (i.e., can access files and folders explicitly selected by the user via an <code>NSOpenPanel</code> GUI).</p>

<p>I have noticed that code coverage stops right after the open panel is presented modally. This is my code:</p>

<pre><code>@IBAction func go(_ sender: Any) {

    let panel = NSOpenPanel()
    panel.canCreateDirectories = true
    panel.canChooseDirectories = true
    panel.canChooseFiles = false
    panel.allowsMultipleSelection = false

    let response = panel.runModal()

    switch response {
    case NSApplication.ModalResponse.OK:
        openPanelDidSelectURL(panel.urls[0])

    default:
        return
    }
}
</code></pre>

<p><em>(I have recorded my UI tests so that the <code>NSOpenPanel</code> is accepted right away, choosing the folder where it was open.)</em></p>

<p>Code coverage ends up highlighted like this:</p>

<p><a href=""https://i.stack.imgur.com/s3rVi.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/s3rVi.png"" alt=""enter image description here""></a></p>

<p>I have tried replacing the <code>switch</code> statement with a <code>fatalError()</code> call, but the UI test still completes successfully, suggesting that anything immediately after:</p>

<pre><code>let response = panel.runModal()
</code></pre>

<p>...is <em>not</em> executed during the test.</p>

<p>Disabling sandboxing seems to have no effect, so I suspect it is running the open panel modally that causes trouble... </p>
",https://stackoverflow.com/questions/55257246/nsopenpanel-breaks-ui-testing-on-macos,"['macos', 'xcode-ui-testing', 'nsopenpanel']",294,True,2,1
Android UI testing with mocked dependencies,"<p>I have an activity in which I provide a button. Clicking on the button invokes a method in a data provider class and based on the return value of the method I make UI changes. Now I want to write an instrumented test where I perform <code>click()</code> in the button but avoid actually calling the method in the data provider class. Instead I want to return a desired value from the method and then check if the UI was modified accordingly.</p>

<p><strong>MyActivity</strong></p>

<pre><code>@Override
    public void onCreate(final Bundle savedInstanceState) {
        mActionButton.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(final View v) {
                boolean result = dataProvider.getResult();
                if(result) {
                   mSuccessTextView.setVisibility(View.VISIBLE);
                }
            }
        });
    }
</code></pre>

<p>Here, on button click, a call is made to <code>DataProvider#getResult</code> and the result from this method is stored in <code>result</code>. If the result is <code>true</code> a TextView <code>mSuccessTextView</code>, previously <code>GONE</code>, is now made <code>VISIBLE</code>.<br>
The problem here is <code>DataProvider#getResult</code> deals with a lot of external components that would make testing impossible. So what I want to do is use a mocked instance of <code>DataProvider</code> so that I can get <code>getResult</code> to return a desired value and then check the visibility of <code>mSuccessTextView</code>. <strong>This is what I tried :</strong><br></p>

<p><strong>MyActivityTest.java</strong></p>

<pre><code>@RunWith(AndroidJUnit4.class)
public class MyActivityTest {

    private DataProvider mDataProvider;

    @Rule
    public IntentsTestRule&lt;MyActivity&gt; mIntentRule =
            new IntentsTestRule&lt;&gt;(MyClientActivity.class);

    @Before
    public void setUp() {
        mDataProvider = mock(DataProvider.class);
    }

    @Test
    public void testResultSuccess() {
        boolean result = true;
        when(mDataProvider.getResult()).thenReturn(result);
        onView(withId(R.id.action_button)).perform(click());
        onView(withId(R.id.success_text_view)).check((ViewAssertion) isDisplayed());
    }
}
</code></pre>

<p>Doing the above generates the following error :</p>

<pre><code>org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class com.domain.myapp.DataProvider.

Mockito can only mock non-private &amp; non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.

Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
.
.
.
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
.
.
.
Caused by: java.lang.IllegalStateException: This JVM's version string does not seem to be valid: 0
.
.
.
</code></pre>
",https://stackoverflow.com/questions/55475604/android-ui-testing-with-mocked-dependencies,"['android', 'mockito', 'ui-testing', 'android-instrumentation']",181,False,0,1
appcenter UI testing for react native project,"<p>What is the best approach to do some automated UI testing on <a href=""https://appcenter.ms"" rel=""noreferrer"">appcenter</a> for my react native app?</p>

<p>Are there any tutorials for UI automation testing with appcenter for react native?</p>
",https://stackoverflow.com/questions/55094844/appcenter-ui-testing-for-react-native-project,"['react-native', 'visual-studio-app-center-test']",159,False,6,0
WebDriverAgentrRunner failed to initialize for UI testing,"<pre><code>Testing failed:
    WebDriverAgentRunner-Runner.app (462) encountered an error (The test runner failed to initialize for UI testing. (Underlying error: Not authorized for performing UI testing actions.))
** TEST FAILED **
</code></pre>

<p>After running command </p>

<pre><code>xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=0836013e8b0dfb9e4c5598974a5d5d5e64761d75' test

-WebDriverAgentRunner gets installed but in terminal displayed error
Testing failed:
    WebDriverAgentRunner-Runner.app (462) encountered an error (The test runner failed to initialize for UI testing. (Underlying error: Not authorized for performing UI testing actions.))
** TEST FAILED **
</code></pre>

<p>Not able to run tests using appium</p>
",https://stackoverflow.com/questions/55216211/webdriveragentrrunner-failed-to-initialize-for-ui-testing,"['ios', 'automation']",887,False,2,0
Flutter UI testing (drive) on multiple devices,"<p>Is there a way to switch between devices while driving an UI test with flutter?
I have an app that synchronizes data across all instances. Typical scenario would be a ToDo app. User creates a todo for himself on his phone, which would appear on his tabled where he is signed in.
Any ideas on how to automate it with flutter drive? I basically need two instances of my app running while testing</p>
",https://stackoverflow.com/questions/58582671/flutter-ui-testing-drive-on-multiple-devices,"['flutter', 'integration-testing']",1090,True,1,1
UI testing accessing specific screen directly : iOS,"<p>I am writing a <code>UI</code> test for my app but the problem is when user signup in  app, takes a phone number and send verification code to that number and on the next screen I have to type in the verification code send to my number. The <code>UI</code> test fails because of this so is there any way I can bypass the verification code screen and jump directly to the next screen</p>
",https://stackoverflow.com/questions/54980811/ui-testing-accessing-specific-screen-directly-ios,"['ios', 'swift', 'xcode-ui-testing']",915,True,0,1
iOS/Swift: &quot;No such module...&quot; for UI Testing,"<p>I'm trying to create automated UI tests for my iOS app. After generally failing to get this working on my existing app, I created a new one from scratch and tried there. It always seems to fail because it can't import dependencies I've installed with Cocoapods.</p>

<p>I'm currently running XCode Version 10.2.1 (10E1001)</p>

<p>Instructions to replicate:</p>

<ol>
<li>Launch XCode, create new project (Single View App, Swift, unit tests and UI tests). I named my project <code>UITestProto</code></li>
<li>Run <code>pod init</code> on the project.</li>
<li>Add the <code>HydraAsync</code> dependency</li>
</ol>

<p>The Podfile should look like this:</p>

<pre><code># Uncomment the next line to define a global platform for your project
platform :ios, '12.2'

target 'UITestProto' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for UITestProto

  target 'UITestProtoTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'UITestProtoUITests' do
    inherit! :search_paths
    # Pods for testing
    pod 'HydraAsync'
  end
end
</code></pre>

<ol start=""4"">
<li>Go to the Build Settings of the <code>UITestProtoUITests</code> target in XCode and set ""Always Embed Swift Standard Libraries"" to <code>$(inherited)</code>:</li>
</ol>

<p><a href=""https://i.stack.imgur.com/Hgptc.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Hgptc.png"" alt=""Embedded swift std libs""></a></p>

<ol start=""5"">
<li>Run <code>pod install</code></li>
<li>Open the project using <code>UITestProto.xcworkspace</code></li>
<li>Open the <code>UITestProtoUITests.swift</code> file and try to import the OHHTTPStubs module.</li>
</ol>

<pre><code>import XCTest

import Hydra

class UITestProtoUITests: XCTestCase {
...
</code></pre>

<p>At this point you should see the error:</p>

<blockquote>
  <p>No such module 'Hydra'</p>
</blockquote>

<p>I've tried: </p>

<ol>
<li>adding <code>@testable import UITestProto</code> because I've had to do that for my unit tests</li>
<li>Making sure ""Enable Testability"" in ""Build Settings"" is set to ""Yes""</li>
</ol>

<p>And I've cleaned the build folder and closed/open XCode after each of those steps, but still no luck on the Hydra import.</p>

<p><em>Note: I'm not actually using Hydra for testing, it's just a library that I've successfully used in projects in the past</em></p>
",https://stackoverflow.com/questions/55766394/ios-swift-no-such-module-for-ui-testing,"['ios', 'swift', 'cocoapods', 'ui-testing']",7407,True,3,3
How to completely automate UI testing in Android?,"<p>Recently we have added some features to our product and are planning for a new release. The issue is, we don't have a dedicated testing team in our organization, so the sole part of testing lies with the development team. Now I bear the responsibility of manually testing all the test-cases and honestly speaking I don't like it.</p>

<p>For each test case, I have to <em>Login -> Perform some button clicks -> Scroll Up/Down -> Wait for Api Call to finish -></em>, etc, etc and then repeat this process for another test case. </p>

<p><strong>Is there some way I can automate this entire process where all the button clicks, text filling, scrolling, etc is taken care of by some library/framework?</strong></p>
",https://stackoverflow.com/questions/59474930/how-to-completely-automate-ui-testing-in-android,"['android', 'testing']",174,True,1,2
Mockito when starts actual method call Android UI Testing,"<p>We have a <code>Configuration</code> class and <code>LocalStorage</code> class Configuration takes LocalStorage instance in constructor, LocalStorage takes <code>Context</code> in constructor. We are just trying to start with UI testing.
We are trying to do this</p>

<pre><code>   private val localStorage = Mockito.mock(LocalStorage::class.java)

   // in our setup method
   Mockito.`when`(localStorage.getString(anyString())).thenReturn(str)
</code></pre>

<p>Here problem is that <code>getString()</code> method call starts happening immediately when tests are run. We have not even written actual test yet. </p>

<p>Mockito Android version: 3.1.0</p>
",https://stackoverflow.com/questions/58709277/mockito-when-starts-actual-method-call-android-ui-testing,"['android', 'mockito', 'android-espresso', 'android-testing']",267,False,2,3
iOS UI testing - UILabel *with* accessibilityIdentifier cannot be found,"<p>I have a <code>UIViewController</code> subclass with a corresponding view designed in interface builder. In interface builder, I've set an accessibility identifier on two labels and <code>Accessibility</code> as a feature is enabled for both.</p>

<p>I want to define my app flow in code, so I load the VC by <code>let vc = storyboard.instantiateViewController(withIdentifier: storyboardIdentifier) as? MyVC</code> rather than by defining segues in IB.</p>

<p>In <code>viewDidLoad</code>, I can confirm that <code>.accessibilityIdentifier</code> <strong>is</strong> set.</p>

<p>And yet, in my tests, the elements cannot be found. This always returns false:</p>

<pre><code>let app = XCUIApplication()
app.staticTexts[""myIdentifier""].waitForExistence(timeout: 10)
</code></pre>

<p>If I then go on to print out the view hierarchy:</p>

<pre><code>print(app.debugDescription)

 →Application, 0x280e55960, pid: 1609, label: 'My App'
    Window (Main), 0x280e55a40, {{0.0, 0.0}, {320.0, 568.0}}
      Other, 0x280e55c00, {{0.0, 0.0}, {320.0, 568.0}}
        NavigationBar, 0x280e55ce0, {{0.0, 20.0}, {320.0, 44.0}}, identifier: 'Thing'
          Button, 0x280e55ea0, {{0.0, 20.0}, {62.0, 44.0}}, label: 'Back'
          Other, 0x280e55f80, {{130.5, 32.0}, {59.5, 20.5}}, label: 'Thing'
        Other, 0x280e56060, {{0.0, 0.0}, {320.0, 568.0}}
          Other, 0x280e56140, {{0.0, 0.0}, {320.0, 568.0}}
            Other, 0x280e56220, {{0.0, 0.0}, {320.0, 568.0}}
              Other, 0x280e56300, {{0.0, 64.0}, {320.0, 504.0}}
                Image, 0x280e563e0, {{0.0, 248.0}, {320.0, 320.0}}, identifier: 'imageName'
</code></pre>

<p>I didn't set the identifier on <code>Image</code> - <code>UIImage(named: ""imageName"")</code> has done that automatically. The labels of interest are descendants of a sibling of the <code>Image</code> (i.e. grandchildren of <code>Other, 0x280e56300</code>)</p>

<p>I've read various guides (<a href=""https://useyourloaf.com/blog/ui-testing-quick-guide/"" rel=""nofollow noreferrer"">1</a>, <a href=""https://www.hackingwithswift.com/articles/148/xcode-ui-testing-cheat-sheet"" rel=""nofollow noreferrer"">2</a>) and believe I'm doing everything as I should, and yet the elements remain hidden to the test framework.</p>

<p><strong>Edited to add:</strong></p>

<p>Since the app being tested is in a separate process, I added a <code>UIAlertController</code> to confirm the <code>.accessibilityIdentifier</code> of the labels of interest when their parent view appears in the context of being driven by the UI test mechanism - they are definitely set, but the testing framework just can't see them.</p>
",https://stackoverflow.com/questions/57579123/ios-ui-testing-uilabel-with-accessibilityidentifier-cannot-be-found,"['ios', 'swift', 'uilabel', 'xcode-ui-testing']",2825,True,2,2
UI Testing - Asserting on Sorting Data (Katalon/Selenium) Java,"<p>I'm about to write some automated UI tests around table sorting.</p>

<p>The sorting allows all columns in a table to be ordered by ascending and descending order. The columns can be a string, date time, int, etc. </p>

<p>Can anyone advise on a pragmatic approach to asserting the columns have been ordered as expected?</p>

<p>Is there an approach that doesn't rely on the data being the same for each test?   </p>
",https://stackoverflow.com/questions/59028156/ui-testing-asserting-on-sorting-data-katalon-selenium-java,"['java', 'selenium', 'groovy', 'ui-testing', 'katalon-studio']",1871,True,1,2
Android UI testing: how to click to Android dialog?,"<p><strong>Problem:</strong><br>
I cannot run test, because when Activity using fullscreen mode, Android dialog (see picture) is showed.</p>

<p><strong>Goal:</strong><br>
I want to click to <code>GOT IT</code> and close the dialog.</p>

<p><strong>Code (Kotlin):</strong></p>

<pre><code>//device is instance of UiDevice UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())

val gotIt = device.findObject(UiSelector()
        //.clickable(true)
        //.checkable(false)
        //.className(""android.widget.Button"")
        //.packageName(""com.android.launcher3"")
        //.resourceId(""android:id/ok"")
        //.index(3) //by index for language-independent
          .text(""GOT IT"")
)
if (gotIt.waitForExists(3000)) {
    try {
        return gotIt.click()
    } catch (e: UiObjectNotFoundException) {
        e.printStackTrace()
    }
} else Log.i(TAG, ""clickViewingFullscreenDialog: btn not exists"")
</code></pre>

<p>I tried many combination of selectors, but i <strong>still cannot click</strong> to <code>GOT IT</code>. Selectors are correct, but dialog is as ""invisible"" or unfocusable. Cannot click to dialog.</p>

<p><strong>Additional info:</strong><br>
Trying on Emulator Nexus 5 Android 7.0.<br>
I tried <code>uiautomatorviewer</code> and <code>layoutinspector</code> to get information about <code>View hierarchy</code> to find this Android <code>Dialog</code>, but i can get information only about <code>android home screen</code> (see second picture), not about own <code>Activity</code> (first picture). </p>

<p><a href=""https://i.stack.imgur.com/Jtu9D.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Jtu9D.png"" alt=""Android dialog""></a>
<a href=""https://i.stack.imgur.com/wWDuj.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/wWDuj.png"" alt=""Home screen dialog""></a></p>
",https://stackoverflow.com/questions/57093680/android-ui-testing-how-to-click-to-android-dialog,"['android', 'ui-automation', 'android-uiautomator']",874,False,0,1
Cannot access button in nib file (UI Testing iOS),"<p>I am writing a UITest case for my view. The problem is I cannot access the button in my nib file view. I gave the accessibility identifier to the button as well but still cannot access it <a href=""https://i.stack.imgur.com/ZRb3A.png"" rel=""nofollow noreferrer"">Here is the image</a></p>

<p>I just want to tap on that reject button but accessibility identifier is not working for this. Here is my code for this </p>

<pre><code>app.buttons[""CancelRequest""].tap()
</code></pre>

<p>CancelRequest is Accessibility identifier. I also tried the below code because button is in a container view but no luck</p>

<pre><code>let ContainerView = app.otherElements[""RejectContainerView""]
let RejectButton = ContainerView.buttons.element(boundBy: 0)  
RejectButton.tap()
</code></pre>

<p>I also tried to record the screen as well which generated this code</p>

<pre><code>app.buttons[""dismiss""].tap()
</code></pre>

<p>The weird thing is the recording screen is generating the same code for the cancel button as well as you can see the cancel button in the image I provided</p>
",https://stackoverflow.com/questions/55063000/cannot-access-button-in-nib-file-ui-testing-ios,"['ios', 'nib', 'xcode-ui-testing', 'ui-testing', 'swift4.1']",487,False,0,1
Calling UI Test functions in sequence (Xcode UI Testing),"<p>I am writing UI Test cases for my app. The problem i am facing is that functions are getting called in an alphabetical order but I want to call the functions in the same sequence I wrote e.g</p>

<pre><code>func testLogout(){}
func testWalkthrough(){}
</code></pre>

<p>Now if you can see the walkthrough screen is the first screen which gets called but because of alphabetical sequence the logout function gets called first which is not the flow of my app</p>
",https://stackoverflow.com/questions/55045054/calling-ui-test-functions-in-sequence-xcode-ui-testing,"['swift', 'xcode', 'xcode-ui-testing']",971,False,0,1
Spring MVC: UI-Testing with Test WebApplicationContext and embedded Jetty,"<p><strong>tldr;</strong> How do I deploy from WebApplicationContext in embedded jetty for a simple automatic test case?</p>

<h3>What I have:</h3>

<p>A spring application (not spring boot) that uses annotation configuration (no web.xml) and is - for production - build (with gradle) to an ear and deployed on wildfly.</p>

<h3>What I ultimately want to do:</h3>

<p>Have self-contained (in the applications test package) ui-tests, that can easily be executed (without building and deploying) like any of the other unit or integration tests.</p>

<h3>What I have done so far:</h3>

<ul>
<li>The easy part: Setup the actual tests with Selenium WebDriver</li>
<li>The hard part: Start an embedded Jetty with a test WebApplicationContext</li>
</ul>

<p>My code for the embedded Jetty (yes, I will do some refactoring when I get it running):</p>

<pre><code>import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.EnumSet;

import javax.servlet.DispatcherType;

import org.apache.tomcat.util.scan.StandardJarScanner;
import org.eclipse.jetty.apache.jsp.JettyJasperInitializer;
import org.eclipse.jetty.jsp.JettyJspServlet;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.session.HashSessionIdManager;
import org.eclipse.jetty.server.session.HashSessionManager;
import org.eclipse.jetty.server.session.SessionHandler;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.resource.Resource;
import org.springframework.security.web.FilterChainProxy;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

public class JettyServerFactory {

    private Server server = null;

    public Server start(WebApplicationContext context) throws Exception {
        if (server == null) {
            this.server = new Server(9090);
            setupServer(context);

            server.start();
            //server.join();
        }
        return server;
    }

    public void stop() throws Exception {
        if (server != null) {
            server.stop();
        }
    }

    private void setupServer(WebApplicationContext context) throws Exception {

        final ServletContextHandler contextHandler = new ServletContextHandler();

        // Since this is a ServletContextHandler we must manually configure JSP support.
        enableEmbeddedJspSupport(contextHandler);

        // Spring Security
        enableSpringSecurity(contextHandler, context);

        /*
        // TODO: Does not seem to have any effect
        // Set reference to actual Spring ApplicationContext
        ServletContext servletContext = contextHandler.getServletContext();
        servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);
        */

        // Set resource base folder
        contextHandler.setBaseResource(getResourceBase());

        // Add DispatcherServlet to context
        final ServletHolder servletHolder = new ServletHolder(""default"", new DispatcherServlet(context));
        servletHolder.setInitParameter(""dirAllowed"", ""true"");
        contextHandler.setContextPath(""/oauth"");
        contextHandler.addServlet(servletHolder, ""/"");

        // Add context to server
        server.setHandler(contextHandler);
    }

    private Resource getResourceBase() {
        File file = new File(""src/website/application.war"");
        //servletHolder.setInitParameter(""resourceBase"", getWebRootResourceUri().toASCIIString());
        final Resource base = Resource.newResource(file);
        return base;
    }

    /**
     * Apply existing securityFilterChain to context
     *
     * @param contextHandler
     * @param context
     */
    private void enableSpringSecurity(ServletContextHandler contextHandler, WebApplicationContext context) {

        FilterChainProxy filter = (FilterChainProxy) context.getBean(""springSecurityFilterChain"");
        FilterHolder filterHolder = new FilterHolder(filter);
        contextHandler.addFilter(filterHolder, ""/*"", EnumSet.allOf(DispatcherType.class));

        server.setSessionIdManager(new HashSessionIdManager());

        HashSessionManager manager = new HashSessionManager();
        SessionHandler sessions = new SessionHandler(manager);
        contextHandler.setHandler(sessions);
    }

    /**
     * Setup JSP Support for ServletContextHandlers.
     * &lt;p&gt;
     * NOTE: This is not required or appropriate if using a WebAppContext.
     * &lt;/p&gt;
     *
     * @param servletContextHandler the ServletContextHandler to configure
     * @throws IOException if unable to configure
     */
    private void enableEmbeddedJspSupport(ServletContextHandler servletContextHandler) throws IOException {
        // Establish Scratch directory for the servlet context (used by JSP compilation)
        File tempDir = new File(System.getProperty(""java.io.tmpdir""));
        File scratchDir = new File(tempDir.toString(), ""embedded-jetty-jsp"");

        if (!scratchDir.exists()) {
            if (!scratchDir.mkdirs()) {
                throw new IOException(""Unable to create scratch directory: "" + scratchDir);
            }
        }
        servletContextHandler.setAttribute(""javax.servlet.context.tempdir"", scratchDir);

        // Set Classloader of Context to be sane (needed for JSTL)
        // JSP requires a non-System classloader, this simply wraps the
        // embedded System classloader in a way that makes it suitable
        // for JSP to use
        ClassLoader jspClassLoader = new URLClassLoader(new URL[0], this.getClass().getClassLoader());
        servletContextHandler.setClassLoader(jspClassLoader);

        // Manually call JettyJasperInitializer on context startup
        servletContextHandler.addBean(new JspStarter(servletContextHandler));

        // Create / Register JSP Servlet (must be named ""jsp"" per spec)
        ServletHolder holderJsp = new ServletHolder(""jsp"", JettyJspServlet.class);
        holderJsp.setInitOrder(0);
        holderJsp.setInitParameter(""logVerbosityLevel"", ""DEBUG"");
        holderJsp.setInitParameter(""fork"", ""false"");
        holderJsp.setInitParameter(""xpoweredBy"", ""false"");
        holderJsp.setInitParameter(""compilerTargetVM"", ""1.8"");
        holderJsp.setInitParameter(""compilerSourceVM"", ""1.8"");
        holderJsp.setInitParameter(""keepgenerated"", ""true"");
        servletContextHandler.addServlet(holderJsp, ""*.jsp"");
    }

    /**
     * JspStarter for embedded ServletContextHandlers
     *
     * This is added as a bean that is a jetty LifeCycle on the ServletContextHandler. This bean's doStart method will
     * be called as the ServletContextHandler starts, and will call the ServletContainerInitializer for the jsp engine.
     *
     */
    public static class JspStarter extends AbstractLifeCycle
            implements ServletContextHandler.ServletContainerInitializerCaller {
        JettyJasperInitializer sci;
        ServletContextHandler context;

        public JspStarter(ServletContextHandler context) {
            this.sci = new JettyJasperInitializer();
            this.context = context;
            this.context.setAttribute(""org.apache.tomcat.JarScanner"", new StandardJarScanner());
        }

        @Override
        protected void doStart() throws Exception {
            ClassLoader old = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(context.getClassLoader());
            try {
                sci.onStartup(null, context.getServletContext());
                super.doStart();
            } finally {
                Thread.currentThread().setContextClassLoader(old);
            }
        }
    }

    private URI getWebRootResourceUri() throws FileNotFoundException, URISyntaxException, MalformedURLException {
        String WEBROOT_INDEX = ""/application.war/"";

        URL indexUri = this.getClass().getResource(WEBROOT_INDEX);

        if (indexUri == null) {
            throw new FileNotFoundException(""Unable to find resource "" + WEBROOT_INDEX);
        }

        File file = new File(""src/website/application.war"");
        System.out.println(indexUri.toURI());
        System.out.println(file.toURI());
        System.out.println(file.getAbsolutePath());

        return file.toURI();
    }
}

</code></pre>

<p>The WebApplicationContext for the test case is simply provided somewhat like this:</p>

<pre><code>...
@WebAppConfiguration
public class ATestClass {

    @Autowired
    WebApplicationContext context;

    ...
    @Before
    public void setupTest() throws Exception {
        new JettyServerFactory().start(context);
        ...
    }
    ...
...
</code></pre>

<p>Location of the Resource Base:
<a href=""https://i.stack.imgur.com/LkphS.png"" rel=""nofollow noreferrer"">Resource placement in the project structure</a></p>

<p>All static resources like css, js and images are in <strong>themes</strong></p>

<h3>What does work:</h3>

<ul>
<li>Controllers are hit on requests</li>
<li>Spring Security is active</li>
<li>JSPs are found and rendered (thanks to <a href=""https://github.com/jetty-project/embedded-jetty-jsp"" rel=""nofollow noreferrer"">https://github.com/jetty-project/embedded-jetty-jsp</a>)</li>
</ul>

<h3>What does not work:</h3>

<ul>
<li>All other static resources are missing (css, js, images, etc.). Basically everything from <strong>themes</strong></li>
</ul>

<h3>So, what are my questions:</h3>

<ol>
<li>How can I make the missing static resources available?</li>
<li>Is there a completely different/better approach to achieve my ultimate goal? The way, to what I have now, was quite rocky and I'm not sure the missing static content is the last of my problems.</li>
</ol>

<p>I'm happy to provide additional information/code. But, since this is an actual product, I have some limits on that.</p>

<h2>Edits:</h2>

<ol>
<li><p><a href=""https://i.stack.imgur.com/QJoeX.png"" rel=""nofollow noreferrer"">Picture of the resource structure</a>
Mind that application.war is just a folder, not actually a war</p></li>
<li><p>Resource Config</p></li>
</ol>

<pre><code>@EnableWebMvc
@Configuration
public class AppWebMvcConfiguration implements WebMvcConfigurer {
    ...

    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        registry.jsp(""/WEB-INF/jsp/"", "".jsp"");
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        boolean developmentMode = configuration.getBooleanFromNewconfig(false, ""oauth2.developmentMode"");
        if (USE_VERSIONED_RESOURCES) {
            registry.addResourceHandler(""/themes/**"")
                    .addResourceLocations(""/themes/"")
                    .setCacheControl(CacheControl.maxAge(365, TimeUnit.DAYS))
                    .resourceChain(developmentMode ? false : true)
                    .addResolver(new VersionResourceResolver().addContentVersionStrategy(""/**""))
                    .addTransformer(new CssLinkResourceTransformer());
        } else {
            registry.addResourceHandler(""/themes/**"")
                    .addResourceLocations(""/themes/"")
                    .setCacheControl(CacheControl.noCache());
        }
    }

    ...
}
</code></pre>

<p>Which case is used for the ResourceHandler doesn't matter. Neither works.</p>
",https://stackoverflow.com/questions/59268102/spring-mvc-ui-testing-with-test-webapplicationcontext-and-embedded-jetty,"['java', 'spring', 'spring-mvc', 'selenium-webdriver', 'embedded-jetty']",263,False,2,0
Detox UI Testing - Tests time out when running on CI,"<p>I'm running react-native android integration tests headlessly using the detox framework on Ubuntu 18.04.</p>

<p>The line that I use to run my test suite as a whole is: 
<code>detox test -c android.emu.ci --headless --cleanup --take-screenshots failing --detectOpenHandles</code>. This runs 7 tests.</p>

<p>When I run the tests like this the first test runs successfully, and then the second test fails, as it seems like the <a href=""https://gist.github.com/juddey/b94ccd9b721273d839e302087edb7f06#file-trace-txt-L586"" rel=""nofollow noreferrer"">emulator is offline</a>.</p>

<p>If I run the tests individually with a 15 second gap between them eg:</p>

<pre><code>    - detox test post.spec.js -c android.emu.ci --headless --cleanup --take-screenshots failing --detectOpenHandles
    - sleep 15s
    - detox test post.report.spec.js -c android.emu.ci --headless --cleanup --take-screenshots failing --detectOpenHandles
    - sleep 15s
</code></pre>

<p>They all complete without failing, so the tests are not the culprit.</p>

<p>I have tried adding a sleep in the afterEach for each test, and as the last action in each test, but neither of these have been successful.</p>

<p>I'm looking for suggestions/direction on what to do to get the tests to wait for the emulator to be ready before executing.</p>
",https://stackoverflow.com/questions/56503726/detox-ui-testing-tests-time-out-when-running-on-ci,"['react-native', 'gitlab-ci', 'detox']",1440,False,1,0
UI Testing with respect to a attribute value iOS/Swift,"<p>I'm writing UI Tests for my application. I've an attribute named <code>numberOfPhotos</code> in <code>PhotosViewController</code> and it's value is set from another ViewController. Whenever <code>numberOfPhotos</code> is 2, only two photos should be displayed in my current <code>PhotosViewController</code>. </p>

<p>I was able to test if required number of images are visible or not but I'm not able to set <code>numberOfPhotos</code> from UITests class. Is there anyway I can set this value and proceed to tests. </p>

<p>Currents I'm editing the code to set value for <code>numberOfPhotos</code> and testing it. Is there anyway I can set this value from UITests class. Thanks.</p>
",https://stackoverflow.com/questions/56024123/ui-testing-with-respect-to-a-attribute-value-ios-swift,"['ios', 'swift', 'testing', 'xcode-ui-testing']",234,False,0,1
How to configure Selenium WebDriver with Spring Boot for UI testing?,"<p>Not able to configure <code>WebDriver</code> correctly hence my functional test are failing for <code>UI</code>.</p>

<p>I looked into both these SO links but not sure how to use the <code>geckodriver.exe</code> here and what is purpose of it.</p>

<ul>
<li><a href=""https://stackoverflow.com/questions/44072400/spring-boot-gui-testing-selenium-webdriver"">Spring Boot GUI Testing Selenium WebDriver</a></li>
<li><a href=""https://stackoverflow.com/questions/44781339/spring-boot-web-application-using-selenium-webdriver"">Spring Boot Web Application using Selenium WebDriver</a></li>
</ul>

<p>I also looked for some online tutorials where <code>Selenium</code> is configured with <code>Spring Boot</code> but most of them are with older versions of Spring.</p>

<p><strong>UPDATE:</strong></p>

<ul>
<li>Downloaded and stored <code>IEDriverServer.exe</code> in <code>C:\FAST</code> directory.  </li>
<li>Added maven dependency for IE </li>
<li>Modified code base by adding <code>System.getProperty</code> and pointing it to the location of <code>IEDriverServer.exe</code></li>
</ul>

<p>Any guidance will be helpful.</p>

<p><strong>pom.xml</strong></p>

<pre><code>   &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
            &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
            &lt;artifactId&gt;selenium-api&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
            &lt;artifactId&gt;selenium-ie-driver&lt;/artifactId&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
</code></pre>

<p><strong>src/main/java/Application.java</strong></p>

<pre><code>@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public WebDriver webDriver() {
        return new InternetExplorerDriver();
    }

}
</code></pre>

<p><strong>src/test/java/ApplicationTests.java</strong></p>

<pre><code>@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTests {

    @Test
    public void contextLoads() {
    }

}
</code></pre>

<p><strong>GoogleSearchPageSeleniumTests.java</strong></p>

<pre><code>@RunWith(SpringRunner.class)
@SpringBootTest
public class GoogleSearchPageSeleniumTests {

    @Autowired
    private WebDriver webDriver;

    @Before
    public void setup() {
        System.setProperty(""webdriver.ie.driver"", ""C:\\FAST\\IEDriverServer.exe"");
        webDriver = new InternetExplorerDriver();
    }

    @Test
    public void getSearchPage() {
        this.webDriver.get(""https://www.google.com"");
        WebElement element = this.webDriver.findElement(By.name(""q""));
        assertNotNull(element);
    }

}
</code></pre>

<p><strong>Error:</strong></p>

<pre><code>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.jpmchase.gct.ft.GoogleSearchPageSeleniumTests': Unsatisfied dependency expressed through field 'webDriver'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webDriver' defined in com.jpmchase.gct.ft.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'webDriver' threw exception; nested exception is java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1336)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:393)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
    at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:44)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webDriver' defined in com.jpmchase.gct.ft.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'webDriver' threw exception; nested exception is java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:591)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1246)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:353)
    at org.springframework.boot.test.autoconfigure.web.servlet.WebDriverScope.get(WebDriverScope.java:58)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:350)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1135)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:581)
    ... 28 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'webDriver' threw exception; nested exception is java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:583)
    ... 40 more
Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
    at com.google.common.base.Preconditions.checkState(Preconditions.java:847)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
    at org.openqa.selenium.ie.InternetExplorerDriverService.access$000(InternetExplorerDriverService.java:32)
    at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.findDefaultExecutable(InternetExplorerDriverService.java:167)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:339)
    at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:291)
    at org.openqa.selenium.ie.InternetExplorerDriver.&lt;init&gt;(InternetExplorerDriver.java:213)
    at org.openqa.selenium.ie.InternetExplorerDriver.&lt;init&gt;(InternetExplorerDriver.java:152)
    at com.jpmchase.gct.ft.Application.webDriver(Application.java:20)
    at com.jpmchase.gct.ft.Application$$EnhancerBySpringCGLIB$$fe85b267.CGLIB$webDriver$0(&lt;generated&gt;)
    at com.jpmchase.gct.ft.Application$$EnhancerBySpringCGLIB$$fe85b267$$FastClassBySpringCGLIB$$88167d66.invoke(&lt;generated&gt;)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365)
    at com.jpmchase.gct.ft.Application$$EnhancerBySpringCGLIB$$fe85b267.webDriver(&lt;generated&gt;)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    ... 41 more

2019-02-08 14:38:56.650  INFO 12096 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@3c77d488: startup date [Fri Feb 08 14:38:56 EST 2019]; root of context hierarchy

Process finished with exit code -1
</code></pre>
",https://stackoverflow.com/questions/54599169/how-to-configure-selenium-webdriver-with-spring-boot-for-ui-testing,"['java', 'spring', 'selenium', 'spring-boot', 'selenium-webdriver']",26593,True,5,3
How to test UI in different iOS version - iOS UI Testing,"<p>I am designing an UI component library.</p>

<p>For certain design requirement, I need to make different implementation by checking the iOS version as the lower version might not support the latest syntax/feature.</p>

<p>There are a few methods in my library which are trying to do</p>

<pre><code>func designSth(){
   if #available(iOS 10.0, *) {
      //implement sth support for iOS 10 and above
   }else{
      //implement sth for device below iOS 10
   }
}
</code></pre>

<p>However when I write the UI test cases, it will always cover the iOS 10 and above but not cover the iOS 10 and below.</p>

<p>Is there a way to set target simulator iOS version in UI testing script?
Such like <code>XCUIApplication</code>, <code>XCUIElement</code> which is able to configure in <code>setUp()</code> in UI testing script.</p>
",https://stackoverflow.com/questions/57390792/how-to-test-ui-in-different-ios-version-ios-ui-testing,"['ios', 'swift', 'xcode', 'xcode-ui-testing']",503,False,4,1
iOS UI testing - picker wheel adjusting only swipes by one item,"<p>I am trying to write a test for UIPickerView to pick certain values. I use <code>picker.adjust(toPickerWheelValue: pickValue)</code> to do so. But the problem is that for some reason this only swipes picker by one value. </p>

<p>For example on the gif you can see that initial value was 52, then I called <code>picker.adjust(toPickerWheelValue: ""15"")</code> and it became 51 instead of 15, then I called it again and it became 50:</p>

<p><a href=""https://i.stack.imgur.com/mmDTr.gif"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/mmDTr.gif"" alt=""wrong picker behaviour""></a></p>

<p>So the pattern is that it only changes it by one value up or down closer to the desired value.</p>

<p>What is the problem here?</p>
",https://stackoverflow.com/questions/59255034/ios-ui-testing-picker-wheel-adjusting-only-swipes-by-one-item,"['swift', 'xcode', 'xcuitest']",944,False,3,1
Why is UI testing at the top of the test pyramid?,"<p>I've been asked by an interviewer the following questions about the diagram below:</p>

<ol>
<li>Why should less effort be required for UI testing?</li>
<li>Is the test pyramid meant for programmers or testers? </li>
</ol>

<p>Thanks for your help on these questions.</p>

<p><a href=""https://i.stack.imgur.com/BRs7F.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/BRs7F.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/56696132/why-is-ui-testing-at-the-top-of-the-test-pyramid,"['selenium', 'user-interface', 'automation', 'automated-tests', 'ui-automation']",1219,False,2,2
Showing a Dialog(Dialog Fragment) inside a fragment in UI testing,"<p>I am writing UI test cases for a fragment. I am using launchFragmentInContainer to launch fragment independent of activity. </p>

<p>Scenario is, on click of a button, a dialog fragment should be shown but when I do that nothing appears on the screen.</p>

<p>This is my primary fragment</p>

<pre><code>    package com.cbre.host.onboarding.locationaccess

import android.Manifest
import android.content.pm.PackageManager
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.activity.OnBackPressedCallback
import androidx.navigation.fragment.findNavController
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.cbre.host.common.AppNavigator
import com.cbre.host.common.BaseFragment
import com.cbre.host.common.utils.Constants
import com.cbre.host.core.permission.PermissionProvider
import com.cbre.host.onboarding.R
import com.cbre.host.onboarding.databinding.LocationAccessFragmentBinding
import kotlinx.android.synthetic.main.location_access_fragment.*
import org.koin.android.ext.android.inject

class LocationAccessFragment : BaseFragment() {

    private lateinit var binding: LocationAccessFragmentBinding
    private val _viewModel: LocationAccessViewModel by fragmentViewModel()
    private val _permissionProvider: PermissionProvider by inject()
    private val _appNavigator: AppNavigator by inject()


    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = LocationAccessFragmentBinding.inflate(inflater, container, false)
        binding.lifecycleOwner = viewLifecycleOwner
        return binding.root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        requireActivity().onBackPressedDispatcher.addCallback(
            viewLifecycleOwner,
            object : OnBackPressedCallback(true) {
                override fun handleOnBackPressed() {
                    // DO NOTHING
                }
            })

        may_be_later.setOnClickListener { findNavController().navigate(R.id.next_action_a) }
        access_location.setOnClickListener { handleLocationAccessPermission() }
        tv_privacy_notice.setOnClickListener {
            _appNavigator.openInChrome(
                context!!,
                Constants.PRIVACY_URL
            )
        }
    }

    override fun invalidate() = withState(_viewModel) { state -&gt;
        binding.run {
            buttonOneText = state.onBoardingContent.button1Text
            buttonTwoText = state.onBoardingContent.button2Text
            imageHelpText = state.onBoardingContent.imageHelpText
            imageText = state.onBoardingContent.imageText
            imageUrl = state.onBoardingContent.imageUrl
        }
    }

    private fun handleLocationAccessPermission() = activity?.let {
        _permissionProvider.checkSelfPermission(
            it,
            permission = Manifest.permission.ACCESS_FINE_LOCATION,
            requestPermission = { requestPermission() },
            granted = {
                findNavController().navigate(R.id.next_action_b)
            },
            shouldShowExplanation = { showDialog() })
    }

    private fun showDialog() {
        val fm = fragmentManager
        fm ?: return
        val dialogFragment = LocationAccessDialogFragment.newInstance()
        dialogFragment.show(fm, ""locationAccessDialog"")
        dialogFragment.callback = object : LocationAccessDialogFragment.Callback {
            override fun onAllow() {
                requestPermission()
            }
        }
    }

    override fun onRequestPermissionsResult(
        requestCode: Int,
        permissions: Array&lt;out String&gt;,
        grantResults: IntArray
    ) {
        when (requestCode) {
            PermissionProvider.REQUEST_CODE -&gt; {
                if ((grantResults.isNotEmpty() &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
                    findNavController().navigate(R.id.next_action_b)
                }
            }
        }
    }

    private fun requestPermission() = requestPermissions(
        arrayOf(Manifest.permission.ACCESS_FINE_LOCATION),
        PermissionProvider.REQUEST_CODE
    )
}
</code></pre>

<p>This is my Dialog Fragment </p>

<pre><code>package com.cbre.host.onboarding.locationaccess

import android.app.AlertDialog
import android.app.Dialog
import android.os.Bundle
import android.view.LayoutInflater
import androidx.fragment.app.DialogFragment
import com.cbre.host.onboarding.databinding.LocationAccessDialogBinding


class LocationAccessDialogFragment : DialogFragment() {

    private lateinit var binding: LocationAccessDialogBinding
    var callback: Callback? = null

    interface Callback {
        fun onAllow()
    }

    companion object {
        fun newInstance() = LocationAccessDialogFragment()
    }

    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
        binding =
            LocationAccessDialogBinding.inflate(LayoutInflater.from(activity), null, false)
        val builder = AlertDialog.Builder(activity)
            .setView(binding.root)

        val d = builder.create()

        d?.window?.decorView?.setBackgroundResource(android.R.color.transparent)

        binding.dontAllow.setOnClickListener {
            this.dismiss()
        }

        binding.allow.setOnClickListener {
            callback?.onAllow()
            this.dismiss()
        }
        return d
    }
}
</code></pre>

<p>and this is my test</p>

<pre><code>@Test
fun a_checkBtnAccessLocationClickForDenyPermission() {
        val scenario = launchFragmentInContainer&lt;LocationAccessFragment&gt;()
        scenario.onFragment { fragment -&gt;
            Navigation.setViewNavController(fragment.requireView(), navController)
        }

        onView(withId(R.id.access_location)).perform(click())
    }
}
</code></pre>
",https://stackoverflow.com/questions/59045001/showing-a-dialogdialog-fragment-inside-a-fragment-in-ui-testing,"['android-fragments', 'testing', 'android-espresso', 'android-dialogfragment', 'android-fragmentscenario']",887,True,2,2
"Android UI testing for MVVM architecture with Dagger2, Espresso and Mockito","<p>I'm trying to add UI tests for the first time to an app, and I was looking at using espresso.</p>

<p>The app uses Dagger2 for DI with <code>@Inject</code> annotations for classes that should be injectable, and <code>AndroidInjection</code>/<code>AndroidSupportInjection</code> in screens (Activity / Fragment).</p>

<pre><code>class Application : android.app.Application(), HasActivityInjector, HasServiceInjector {
...
    override fun onCreate() {
        super.onCreate()
        initDagger()
        Timber.d(""Application initialized successfully!"")
    }

    protected open fun initDagger() {
        Components.initialize(this)
    }
}

object Components : ComponentFactory {
    private lateinit var sComponent: AppComponent

    fun initialize(app: Application) {
         sAppComponent = DaggerAppComponent.builder()
            .applicationModule(ApplicationModule(this))
            .build()
    }
    // overrides
}

interface ComponentFactory {
    fun app(): AppComponent
    fun authenticated(): AuthenticatedComponent
}
</code></pre>

<p>Next the <code>Component</code>s and <code>Module</code>s. The <code>AppActivitiesModule</code> and <code>AuthenticatedActivitiesModule</code> are classes with <code>@ContributesAndroidInjector</code> for screens.</p>

<pre><code>@Singleton
@Component(modules = [AppModule::class, AppActivitiesModule::class, AndroidInjectionModule::class, AndroidSupportInjectionModule::class])
interface AppComponent {

    fun authenticatedComponentBuilder(): AuthenticatedComponent.Builder

    fun inject(app: Application)

    @Component.Builder
    interface Builder {
        fun build(): AppComponent

        fun applicationModule(applicationModule: ApplicationModule): Builder
    }
}

@Module
open class AppModule(private val application: Application) {
// some @Provides
}
</code></pre>

<pre><code>@AuthenticatedScope
@Subcomponent(modules = [AuthenticatedModule::class, AuthenticatedActivitiesModule::class])
interface AuthenticatedComponent {

    fun inject(application: Application)

    @Subcomponent.Builder
    interface Builder {
        fun userModule(module: UserModule): Builder

        fun build(): AuthenticatedComponent
    }
}


@Module
class AuthenticatedModule(private val userId: Long,
                          private val userRole: User.Role) {
// Some @Provides @AuthenticatedScope
}
</code></pre>

<p>And a typical use case would be:</p>

<pre><code>@Singleton
class AppLevelService 
@Inject constructor(...) { ... }

@AuthenticatedScope
class AuthenticatedLevelServices 
@Inject constructor(...) { ... }

class ViewModel 
@Inject constructor(private val appService: AppLevelService,
                    private val authService: AuthenticatedLevelServices) { ... }

class MyActivity : BaseActivity {
    @Inject 
    lateinit var vmProvider: Provide&lt;ViewModel&gt;

    override fun onCreate(savedInstanceState: Bundle?) {
        AndroidInjection.inject(this)
    }
}
</code></pre>

<p>How can I make the test setup for this ""type"" of dagger usage?</p>

<p>I find a lot of examples of testing with dagger2 but for <code>@Provides</code> annotations, and I'm thinking there should be a way to mock injectable classes with <code>@Inject</code>.</p>

<p>I've tried <code>DaggerMock</code> but I get:</p>

<blockquote>
  <p>You must define overridden objects using a @Provides annotated method instead of using @Inject annotation</p>
</blockquote>

<p>Not that it should affect anything, but I'm also using a custom Runner with <code>DexOpener</code>.</p>

<p>Any ideas or good documentation / examples for testing this setup?</p>
",https://stackoverflow.com/questions/54902412/android-ui-testing-for-mvvm-architecture-with-dagger2-espresso-and-mockito,"['android', 'mockito', 'dagger-2', 'android-espresso', 'dagger']",976,False,1,0
Does anyone know what happened to test results for Xcode 11 UI testing?,"<p>I used to be able to access results in Derived Data inside the .xcresults package.  .xcresults package still exists, but where there used to be a file named ""TestSummaries.plist"", and subdirectories containing attachments (like screenshot files, etc), there is now a subdir named ""Data"" which contains binary format files.  So now I can no longer programmatically extract screenshot files, or upload test results to a database like qTest or ALM.</p>

<p>I have confirmed that Xcode 10 still outputs results in the old format.  I have searched on my machine for the ""TestSummaries.plist"" file or similar artifacts thinking that perhaps they would be in a different location.  No luck so far.</p>
",https://stackoverflow.com/questions/58383456/does-anyone-know-what-happened-to-test-results-for-xcode-11-ui-testing,"['xcode-ui-testing', 'xcode11']",3463,True,11,2
"Android UI Testing with Espresso, Mockito, Koin and Kotlin gives mocking problems","<p>I'm trying to to test my fragment and my test looks like this:</p>

<pre><code>@ExperimentalCoroutinesApi
@RunWith(AndroidJUnit4::class)
@LargeTest
class AccountFragmentTest {
    @Mock
    private lateinit var repositoryMock: Repository
    private lateinit var accountViewModel: AccountViewModel
    private var fakeAccount: Account? = null
    private val dataModule = module {
        viewModel { AccountViewModel(get(), get()) }
    }
    private val coroutinesModule = module {
        single { CoroutineContextProvider() }
    }
    @get:Rule
    val activityRule = ActivityTestRule(AccountActivity::class.java, true, false)

    @Before
    fun setup() {
        MockitoAnnotations.initMocks(this)
        loadKoinModules(listOf(dataModule, coroutinesModule))
        accountViewModel =
            AccountViewModel(
                repositoryMock,
                TestCoroutinesContextProvider()
            )
        val json = javaClass.classLoader?.getResourceAsStream(""transactions.json"").toString()
        fakeAccount = Moshi.Builder().build().adapter&lt;Account&gt;(Account::class.java).fromJson(json)
        `when`(accountViewModel.accountLiveData).thenReturn(MutableLiveData&lt;Account&gt;().apply {
            value = fakeAccount
        })
    }


    @Test
    fun transactionsRecyclerView_shouldBeShown() = runBlockingTest {
        activityRule.launchActivity(null)
        onView(ViewMatchers.withId(R.id.transactionsRecyclerView)).check(matches(isDisplayed()))
    }
</code></pre>

<p>However, I'm getting this exception in my tests:</p>

<pre><code>    ----- begin exception -----
E/TestRunner: java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
        at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:74)
        at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
        at $Proxy9.isTypeMockable(Unknown Source)
        at org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:29)
        at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
        at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:240)
        at org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:228)
        at org.mockito.internal.MockitoCore.mock(MockitoCore.java:61)
        at org.mockito.Mockito.mock(Mockito.java:1908)
        at org.mockito.internal.configuration.MockAnnotationProcessor.processAnnotationForMock(MockAnnotationProcessor.java:44)
        at org.mockito.internal.configuration.MockAnnotationProcessor.process(MockAnnotationProcessor.java:19)
        at org.mockito.internal.configuration.MockAnnotationProcessor.process(MockAnnotationProcessor.java:16)
        at org.mockito.internal.configuration.IndependentAnnotationEngine.createMockFor(IndependentAnnotationEngine.java:38)
        at org.mockito.internal.configuration.IndependentAnnotationEngine.process(IndependentAnnotationEngine.java:62)
        at org.mockito.internal.configuration.InjectingAnnotationEngine.processIndependentAnnotations(InjectingAnnotationEngine.java:49)
        at org.mockito.internal.configuration.InjectingAnnotationEngine.process(InjectingAnnotationEngine.java:41)
        at org.mockito.MockitoAnnotations.initMocks(MockitoAnnotations.java:69)
        at me.myapp.package.ui.main.AccountFragmentTest.setup(AccountFragmentTest.kt:53)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:76)
        at androidx.test.internal.runner.junit4.statement.RunAfters.evaluate(RunAfters.java:61)
        at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:531)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:104)
        at org.junit.runners.Suite.runChild(Suite.java:128)
        at org.junit.runners.Suite.runChild(Suite.java:27)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
        at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
        at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
        at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189)
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/tools/ToolProvider;
        at or
    ----- end exception -----
</code></pre>

<p>I'm suspicious that it might have to do with some dependencies stepping on each other, so here's my <code>app/build.gradle</code>:</p>

<pre><code>dependencies {
    implementation fileTree(dir: ""libs"", include: [""*.jar""])
    implementation ""org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version""
    implementation ""org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2""
    implementation ""androidx.appcompat:appcompat:1.1.0""
    implementation ""androidx.core:core-ktx:1.1.0""
    implementation ""androidx.constraintlayout:constraintlayout:1.1.3""
    implementation ""androidx.lifecycle:lifecycle-extensions:2.1.0""
    implementation ""androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0""
    implementation ""androidx.recyclerview:recyclerview:1.0.0""
    implementation ""com.squareup.moshi:moshi-kotlin:1.8.0""
    implementation ""com.squareup.moshi:moshi-adapters:1.8.0""
    implementation ""androidx.cardview:cardview:1.0.0""
    implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'
    implementation ""org.koin:koin-android:2.0.1""
    implementation ""org.koin:koin-androidx-viewmodel:2.0.1""
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    kapt ""com.squareup.moshi:moshi-kotlin-codegen:1.8.0""

    testImplementation ""org.koin:koin-test:2.0.1""
    testImplementation ""junit:junit:4.12""
    testImplementation ""org.robolectric:robolectric:4.3""
    testImplementation ""com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0""
    testImplementation ""android.arch.core:core-testing:1.1.1""
    testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.2'

    androidTestImplementation 'org.mockito:mockito-android:3.0.0'
    androidTestImplementation ""com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0""
    androidTestImplementation ""android.arch.core:core-testing:1.1.1""
    androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.2'
    androidTestImplementation ""androidx.test:runner:1.2.0""
    androidTestImplementation ""androidx.test.espresso:espresso-core:3.2.0""
    androidTestImplementation ""junit:junit:4.12""
    androidTestImplementation('org.threeten:threetenbp:1.3.2') {
        exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
    }
    // debugImplementation because LeakCanary should only run in debug builds.
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test:rules:1.2.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    debugImplementation ""com.squareup.leakcanary:leakcanary-android:2.0-beta-3""
    debugImplementation('androidx.fragment:fragment-testing:1.1.0') {
        exclude group: 'androidx.test', module: 'core'
    }
</code></pre>

<p>I hope somebody can help out here, thanks a lot!</p>
",https://stackoverflow.com/questions/58185029/android-ui-testing-with-espresso-mockito-koin-and-kotlin-gives-mocking-problem,"['java', 'android', 'mockito', 'android-espresso', 'koin']",1209,False,5,0
Mock API calls made in Application class as part of UI testing,"<p><strong>Background:</strong></p>

<p>Our Android Application, onCreate, launches some initialisation use cases that execute some network API calls.</p>

<p>In parallel, our LAUNCHER Activity is launched.</p>

<p>In our UI Tests, we use MockWebServer to stub API responses and we use ANDROIDX_TEST_ORCHESTRATOR 1.1.1</p>

<p><strong>Problem:</strong></p>

<p>In our UI tests involving the Main Activity, we would like to stub different responses for the initialisation API calls, from the test.</p>

<p>In other words, each test should be able to specify what responses the initialisation API calls return.</p>

<p>However, since the initialisation services launch before the Activity, and all the code in the UI tests run AFTER the application is already launched. We are no able to influence the responses that occur before it.</p>

<p><strong>Question:</strong></p>

<p>Is there a way to manually launch the application from within a Test like we can do with an ActivityTestRule for an Activity? This will allow us to stub the initialisation API calls based on the requirements of the test and then launch the application.</p>
",https://stackoverflow.com/questions/59030276/mock-api-calls-made-in-application-class-as-part-of-ui-testing,"['android', 'mocking', 'android-espresso', 'android-testing', 'mockwebserver']",438,False,2,1
Is it possible to simulate two finger swipe in iOS UI Testing?,"<p>I want to perform a two finger swipe in my UI Test. I am using XCUITest framework. I tried all pinch and rotate methods but Seems like there is no built in support for this functoinality.</p>
",https://stackoverflow.com/questions/56110952/is-it-possible-to-simulate-two-finger-swipe-in-ios-ui-testing,"['ios', 'swift', 'swipe', 'gesture', 'xcuitest']",472,False,1,1
"In Web UI Testing, is it possible to get the JSON response?","<p>I am very new to Katalon Studio and had just a beginner experience using Jmeter. I  knew how to code JsonSlurper since I used it often when creating JMeter test scripts. </p>

<p>So is it possible to use JsonSlurper in a web UI test case in Katalon Studio? Or is it only possible in API testing? Please help TIA!</p>
",https://stackoverflow.com/questions/55962750/in-web-ui-testing-is-it-possible-to-get-the-json-response,"['json', 'katalon-studio', 'jsonslurper']",233,True,0,1
How to tap on specific word of a label in Xcode10 Ui Testing?,"<p>Ex:- This is my original String “I agree to the Terms and Conditions and Privacy Policy”.</p>

<p>The “Terms and Conditions” string in the above line is not a link, it exists as part of whole ‘Label’ and I want to tap on specific “Terms and Conditions”.</p>

<p>I applied tap gesture event to ""Terms and Conditions"" String in label. When the User clicks on the ""Terms and Conditions"" string it navigates to another screen.</p>

<p>--> I'm unable to tap on ""Terms and Conditions"" in my Test cases(not working).</p>
",https://stackoverflow.com/questions/54801019/how-to-tap-on-specific-word-of-a-label-in-xcode10-ui-testing,"['xctest', 'xcode-ui-testing', 'xctestcase']",1246,True,0,2
Android emulator: configure how to press Tab to advance to next TextFormField for easier human UI testing?,"<p>(On the web as a keyboard-centric developer I'm spoiled being able to press the Tab key on my keyboard to advance the form focus to the next field.)</p>

<p>I haven't been able to figure out how to do this inside the Android emulator while developing/testing my first Flutter app.  I have to manually move my mouse to bring focus to the next form field.</p>

<p>My gut feeling is that everyone has had this frustration doing their first Flutter form and there must be a simple setting or easy way enable it?</p>
",https://stackoverflow.com/questions/59007754/android-emulator-configure-how-to-press-tab-to-advance-to-next-textformfield-fo,"['android', 'flutter', 'android-emulator', 'ios-simulator']",664,True,0,1
IOS UI Testing: how to dismiss a series of system alerts( microphone access ) via code using fastlane snapshot,"<p>I use mac mojave 10.14.3 and react-native version - 0.59.1, fastlane latest version. I tried to run the fastlane screenshot via ios xcuitest But I couldn't dismiss the system alert. I have attached my code and alert screen</p>

<p>Could you please help me</p>

<pre><code>addUIInterruptionMonitor(withDescription: ""System Dialog"") {
        (alert) -&gt; Bool in
        let okButton = alert.buttons[""OK""]
        if okButton.exists {
          okButton.tap()
        }

        let allowButton = alert.buttons[""Allow""]
        if allowButton.exists {
          allowButton.tap()
        }

        return true
      }

      app.tap()
      snapshot(""04EndRecord"")
</code></pre>

<p>this is my alert and app. this alert shows outside of the app, then how can i handle that?</p>

<p><img src=""https://i.stack.imgur.com/PZn7o.png"" alt=""Microphone access alert""></p>
",https://stackoverflow.com/questions/56287813/ios-ui-testing-how-to-dismiss-a-series-of-system-alerts-microphone-access-vi,"['ios', 'swift', 'react-native', 'xcuitest', 'fastlane-snapshot']",330,False,0,2
"Can anyone suggest me any tools using which I can schedule my UI testing, so that it automatically starts testing at a given interval of time","<p>I want to write a scheduler inside my java code that schedules my UI test cases and it automatically starts testing at the given time. Suggestion needed for plugins or tools.</p>
",https://stackoverflow.com/questions/56349110/can-anyone-suggest-me-any-tools-using-which-i-can-schedule-my-ui-testing-so-tha,"['selenium', 'automation', 'scheduled-tasks', 'ui-automation', 'scheduling']",36,True,-4,1
StackOverflow Exception in TypeDescriptor.GetConverter,"<p>In two of our automated UI testing machines (Win7 and Win10) running Ranorex, I do get StackOverflow Exceptions from time to time. The stackoverflow occurs within the <code>TypeDescriptor.GetConverter</code>. My Code:</p>

<pre><code>public class MyDataObject : ICustomTypeDescriptor
{
...
    public TypeConverter GetConverter()
    {
        return TypeDescriptor.GetConverter(this, true);
    }
...
}
</code></pre>

<p>and here the call stack from the stackoverflow exception:</p>

<pre><code>System_ni!System.ComponentModel.TypeDescriptor+AttributeProvider.GetTypeDescriptor(System.Type, System.Object)+4 
System_ni!System.ComponentModel.TypeDescriptor+TypeDescriptionNode+DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()+64 
System_ni!System.ComponentModel.TypeDescriptor+AttributeProvider+AttributeTypeDescriptor.GetAttributes()+1b 
System_ni!System.ComponentModel.TypeDescriptor+TypeDescriptionNode+DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()+7c 
System_ni!System.ComponentModel.TypeDescriptor+AttributeProvider+AttributeTypeDescriptor.GetAttributes()+1b 
...
...
...
System_ni!System.ComponentModel.TypeDescriptor+TypeDescriptionNode+DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()+83    
System_ni!System.ComponentModel.TypeDescriptor+TypeDescriptionNode+DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()+83    
System_ni!System.ComponentModel.TypeDescriptor+TypeDescriptionNode+DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()+83    
MyDataObject.GetConverter()    
System_ni!System.ComponentModel.TypeDescriptor+MergedTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()$##6004537+18    
DevExpress.XtraVerticalGrid.Data.PropertyHelper.GetConverter(System.ComponentModel.ITypeDescriptorContext, System.Object)    
DevExpress.XtraVerticalGrid.Data.PropertyHelper.GetProperties(System.Object, System.ComponentModel.ITypeDescriptorContext, System.Attribute[])    
DevExpress.XtraVerticalGrid.Events.CustomPropertyDescriptorsEventArgs.get_Properties() 
...
My.Program.Main(System.String[])
</code></pre>

<p>This happens only in automated UI testing - so far...</p>

<p>If it happens, the error stays. Reboot does not resolve it. We have to delete the corresponding dataobject.</p>

<p>We are running VS 2017, .Net 4.6, DevExpress Grid and use Ranorex for automated tests.
Any ideas or hints?</p>
",https://stackoverflow.com/questions/59352325/stackoverflow-exception-in-typedescriptor-getconverter,"['c#', '.net', 'ranorex', 'typedescriptor', 'icustomtypedescriptor']",254,False,1,0
appcenter UI testing for react native project,"<p>What is the best approach to do some automated UI testing on <a href=""https://appcenter.ms"" rel=""noreferrer"">appcenter</a> for my react native app?</p>

<p>Are there any tutorials for UI automation testing with appcenter for react native?</p>
",https://stackoverflow.com/questions/55094844/appcenter-ui-testing-for-react-native-project,"['react-native', 'visual-studio-app-center-test']",159,False,6,0
How to test UI in different iOS version - iOS UI Testing,"<p>I am designing an UI component library.</p>

<p>For certain design requirement, I need to make different implementation by checking the iOS version as the lower version might not support the latest syntax/feature.</p>

<p>There are a few methods in my library which are trying to do</p>

<pre><code>func designSth(){
   if #available(iOS 10.0, *) {
      //implement sth support for iOS 10 and above
   }else{
      //implement sth for device below iOS 10
   }
}
</code></pre>

<p>However when I write the UI test cases, it will always cover the iOS 10 and above but not cover the iOS 10 and below.</p>

<p>Is there a way to set target simulator iOS version in UI testing script?
Such like <code>XCUIApplication</code>, <code>XCUIElement</code> which is able to configure in <code>setUp()</code> in UI testing script.</p>
",https://stackoverflow.com/questions/57390792/how-to-test-ui-in-different-ios-version-ios-ui-testing,"['ios', 'swift', 'xcode', 'xcode-ui-testing']",503,False,4,1
How to set UserDefaults with XCUItest,"<p>I am doing iOS UI testing with XCUITest.
Since we do not have access to the app, how do we set defaults to the app?</p>
",https://stackoverflow.com/questions/58223467/how-to-set-userdefaults-with-xcuitest,"['ios', 'nsuserdefaults', 'xcuitest']",1612,True,0,4
How to print the text using a locator from the span in selenium webdriver python?,"<p>I am using the selenium for UI testing. I have below inspect element of chrome browser.</p>

<pre><code>&lt;div tabindex=""-1"" unselectable=""on"" role=""gridcell"" comp-id=""2815"" col-id=""StartBaseMV"" class=""ag-cell ag-cell-not-inline-editing ag-cell-with-height cell-number ag-cell-value"" style=""width: 120px; left: 2020px; text-align: right; ""&gt;
  &lt;span&gt;
      &lt;span class=""ag-value-change-delta""&gt;&lt;/span&gt;
      &lt;span class=""ag-value-change-value""&gt;($5,281,158)&lt;/span&gt;
  &lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>What I tried for writing xpath.</p>

<pre><code>//div[@col-id=""StartBaseMV"" and @class=""ag-cell ag-cell-not-inline-editing ag-cell-with-height cell-number ag-cell-value""]/span[@class=""ag-value-change-data""]/span[@class=""ag-value-change-value""]
</code></pre>

<p>But, it's not working. Suggest any clue</p>
",https://stackoverflow.com/questions/57574316/how-to-print-the-text-using-a-locator-from-the-span-in-selenium-webdriver-python,"['python', 'selenium', 'xpath', 'css-selectors', 'webdriverwait']",659,True,2,3
How to take input from file in android espresso?,"<p>I am using <strong>android espresso</strong> for UI testing. For my huge project I need to take input from a file(csv, Excel ect.). How can I get it?</p>
",https://stackoverflow.com/questions/56164443/how-to-take-input-from-file-in-android-espresso,['android-espresso'],375,False,0,1
Android Studio 3.5.2 androidx test became an unresolved reference,"<p>This morning, my android studio updated automatically.</p>

<p>And UI testing with espresso is broken.</p>

<p>The android jetpack test module became an unresolved reference now.</p>

<p>Do you have any solution for it?</p>

<pre><code>13:11   Executing tasks: [:app:assembleMockDebugEmulator] in project /Users/hyung-jun.yoo/gitlab/app-banking-android

13:11   Gradle build finished in 4 s 910 ms

13:11   Install successfully finished in 6 s 829 ms.

13:11   Emulator: Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...

13:11   Emulator: Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...

13:11   Emulator: Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...

13:11   Emulator: Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...

13:11   Emulator: Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory...

13:11   Emulator: Qt WebEngine locales directory not found at location /Users/hyung-jun.yoo/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.

13:11   Emulator: Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory...

13:11   Emulator: Path override failed for key ui::DIR_LOCALES and path '/Users/hyung-jun.yoo/.QtWebEngineProcess'

13:11   Emulator: Qt WebEngine locales directory not found at location /Users/hyung-jun.yoo/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.

13:11   Emulator: Path override failed for key ui::DIR_LOCALES and path '/Users/hyung-jun.yoo/.QtWebEngineProcess'

13:11   Emulator: Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...

13:11   Emulator: Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...

13:11   Emulator: Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...

13:11   Emulator: Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...

13:11   Emulator: [1128/131156.257359:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale

13:11   Emulator: [1128/131156.257378:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale
</code></pre>
",https://stackoverflow.com/questions/59088293/android-studio-3-5-2-androidx-test-became-an-unresolved-reference,"['android', 'android-espresso', 'androidx', 'androidx-test']",634,False,1,0
"Espresso, Find dialog and dismiss it","<p>I tried to find a dialog cancel button and push it in Espresso UI Testing, but I couldn't.</p>

<p>This is my code.</p>

<pre><code>onView(withId(R.id.dialog_close_button)).check(matches(isDisplayed()))
</code></pre>

<p>What is the best solution for it?</p>

<p>Please comment your opinion.</p>
",https://stackoverflow.com/questions/58132487/espresso-find-dialog-and-dismiss-it,"['android', 'android-espresso', 'android-dialogfragment', 'android-dialog', 'ui-testing']",1986,True,2,3
Why is UI testing at the top of the test pyramid?,"<p>I've been asked by an interviewer the following questions about the diagram below:</p>

<ol>
<li>Why should less effort be required for UI testing?</li>
<li>Is the test pyramid meant for programmers or testers? </li>
</ol>

<p>Thanks for your help on these questions.</p>

<p><a href=""https://i.stack.imgur.com/BRs7F.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/BRs7F.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/56696132/why-is-ui-testing-at-the-top-of-the-test-pyramid,"['selenium', 'user-interface', 'automation', 'automated-tests', 'ui-automation']",1219,False,2,2
webdriverIO - Unhandled promise rejection: NoSuchSessionError: invalid session id,"<p>I'm learning UI testing with Jasmine &amp; WebdriverIO. I use it with NodeJS.
I have the next test code:</p>

<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-js lang-js prettyprint-override""><code>const projectsPage = require('../../lib/pages/projects.page');
const by = require('selenium-webdriver').By;

describe('Projects page', () =&gt; {
  it('Search google', async() =&gt; {
    await projectsPage.navigateTo();
    driver.getTitle().then(function(title) {
      expect(title).toBe('Google');
    });
    driver.findElement(by.name('q')).sendKeys('test');
  })
});</code></pre>
</div>
</div>
</p>

<p>When I run it, I receive the error:</p>

<pre><code>Unhandled promise rejection: NoSuchSessionError: invalid session id
      (Driver info: chromedriver=2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e),platform=Mac OS X 10.14.5 x86_64)
</code></pre>

<p>But the code below performs successfully:</p>

<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-js lang-js prettyprint-override""><code>describe('Projects page', () =&gt; {
  it('Search google', async() =&gt; {
    await projectsPage.navigateTo();
    driver.getTitle().then(function(title) {
      expect(title).toBe('Google');
    });
    driver.findElement(by.name('q'))
  })
});</code></pre>
</div>
</div>
</p>

<p>Where I was wrong?</p>
",https://stackoverflow.com/questions/56294850/webdriverio-unhandled-promise-rejection-nosuchsessionerror-invalid-session-i,"['javascript', 'node.js', 'jasmine', 'webdriver-io']",3514,True,1,2
How do I automate share file functionality using XCUItest,"<p>My application has ability to preview file which is shared by other application. I want to automate the share file testing using UI testing provided by Xcode.</p>

<p>How do I automate share file functionality using XC UI test in Xcode? </p>
",https://stackoverflow.com/questions/54647147/how-do-i-automate-share-file-functionality-using-xcuitest,"['swift', 'xcode', 'xcuitest']",117,False,2,0
XCUITest: find CollectionView inside TableView failed,"<p>I'm trying to monitoring UI change of Collection View inside Table View for UI testing, but i can't seem to find the solution. I have tried to do many things, one of them is <code>app.tables.children(matching: .cell).element(boundBy: 0).collectionViews.children(matching: .cell).element(boundBy: 0).tap() code here</code>, but nothing works. Thanks.</p>
",https://stackoverflow.com/questions/54284827/xcuitest-find-collectionview-inside-tableview-failed,"['ios', 'swift', 'xcode', 'xcuitest']",585,True,0,1
Steps to build full stack application iOS,"<p>What is the basic approach for mobile app development and how to choose technologies specifically for iOS?
What I mean is, what should the first step be; for ex.</p>

<p>1.UI development</p>

<p>2.UI testing</p>

<p>3.Backend</p>

<p>and so on?</p>
",https://stackoverflow.com/questions/55996700/steps-to-build-full-stack-application-ios,"['ios', 'mobile']",30,False,0,1
"cypress, looping though visible elements, but getting asserts for hidden as well","<p>I have a very strange situation when trying to test a filter selection on the page. I have a list of items and hiding some of them based on the selected filter. The hidden element has a forced style as ""display: none"", which should be treated to cypress as a non-visible element.</p>

<p>But I'm getting this hidden item checked and as a result my test failing. </p>

<p>I hope some of you came across similar issues and can help to understand what am I doing wrong.
(I have a suspicion it has something to do with when the element became hidden and cypress not picking up it properly). I'm very new cypress UI testing and UI testing overall.</p>

<p>This is a sample code:</p>

<pre><code>cy.get("".row.uicomponent__devices-block .devices-item-wrapp:not(:hidden)"")
    .should(""have.length"", 14)
    .each(function ($el, index, $list) {
        if ($el.is("":not(:hidden)"")) {
            cy.get($el).should('have.attr', 'data-filter-brand', 'apple')
        }
    })
</code></pre>

<p><a href=""https://i.stack.imgur.com/7yDsq.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/7yDsq.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/58905124/cypress-looping-though-visible-elements-but-getting-asserts-for-hidden-as-well,"['cypress', 'ui-testing']",1007,False,0,0
How to handle popup window in Karate,"<p>I'm starting using Karate for UI testing and not able to find key word to handle popup window. There is a certificate selection window popup, I need to click ok button as the proper certificate is defaulted selected. Any advice and suggestions to click OK button on the popup?</p>
",https://stackoverflow.com/questions/58313070/how-to-handle-popup-window-in-karate,['karate'],1199,False,1,1
"How does Selenium get the hiding text from knockout&#39;s data-bind like data-bind=&quot;textInput: overridePassword, enable: false&quot;","<p>I am creating <code>selenium</code> automation for our UI testing, and I tried to generate a random password for a user. How does <code>selenium 3</code> <code>WebDriver</code> based on <code>C#</code> get the text of <code>html5</code> knockout data-bind? I am using <code>selenium 3</code> framework based on <code>C#</code> and <code>Visual Studio 2019</code></p>

<pre><code>&lt;input id=""txtGeneratedPassword"" type=""text"" class=""form-control"" data-bind=""textInput: overridePassword, enable: false"" title="""" disabled=""""&gt;
</code></pre>

<p>The following is the part of my code:</p>

<pre><code>IWebElement passwd_text = driver.FindElement(By.Id(""txtGeneratedPassword""));
Console.WriteLine(driver.ExecuteJavaScript&lt;String&gt;(""return 
arguments[0].textContent"", passwd_text)); 
</code></pre>

<p>but nothing is displayed</p>
",https://stackoverflow.com/questions/57699477/how-does-selenium-get-the-hiding-text-from-knockouts-data-bind-like-data-bind,"['c#', 'selenium']",340,False,-2,1
UI test to validate that clicking on the menu item in the toolbar updates the RecyclerView,"<p>I am new to UI testing using Espresso. I want sample Test for checking that if I press menu item in toolbar it updates Recyclerview or not.</p>

<p>I have written till performing the click on toolbar menu but can't find how to check if Recyclerview is updated or not</p>

<pre><code>    import org.junit.Rule;
    import org.junit.Test;

    import androidx.test.rule.ActivityTestRule;

    import static androidx.test.espresso.Espresso.onView;
    import static androidx.test.espresso.action.ViewActions.click;
    import static androidx.test.espresso.assertion.ViewAssertions.matches;
    import static androidx.test.espresso.matcher.ViewMatchers.withId;
    import static androidx.test.espresso.matcher.ViewMatchers.withText;

    public class MainActivityTest {

    @Rule
    public ActivityTestRule&lt;MainActivity&gt; mActivityTestRule =
            new ActivityTestRule&lt;&gt;(MainActivity.class);

    private IdlingResource mIdlingResource;

    @Before
    public void registerIdlingResource() {
    mIdlingResource = mActivityTestRule.getActivity().getIdlingResource();
    Espresso.registerIdlingResources(mIdlingResource);
    }

    @Test
    public void clickFilterBUtton_UpdatesRecyclerview() {

    int adapterSizeBeforeUpdate, adapterSizeAfterUpdate;

    adapterSizeBeforeUpdate = getRVcount();

    onView((withId(R.id.action_filter)))
            .perform(click());

    adapterSizeAfterUpdate= getRVcount();

    Assert.assertTrue(adapterSizeBeforeUpdate!=adapterSizeAfterUpdate);

    }

    @After
    public void unregisterIdlingResource() {
        if (mIdlingResource != null) {
            Espresso.unregisterIdlingResources(mIdlingResource);
        }
    }

    private int getRVcount(){
        GridView gridView = (GridView) 
mActivityTestRule.getActivity().findViewById(R.id.tea_grid_view);
        return gridView.getAdapter().getCount();
    }

}
</code></pre>
",https://stackoverflow.com/questions/55121366/ui-test-to-validate-that-clicking-on-the-menu-item-in-the-toolbar-updates-the-re,"['android', 'android-espresso', 'ui-testing']",1027,True,0,1
Can bigquery or Firebase analytics data acessible from ios app side programmatically?,"<p>I have Firebase analytics data and enabled BigQuery. But I have a requirement to validate the number of events and screens at app side under automated UI testing. Anyway to access  and validate the Firebase analytics data at ios app side programmatically either in swift or objective c?</p>
",https://stackoverflow.com/questions/57947395/can-bigquery-or-firebase-analytics-data-acessible-from-ios-app-side-programmatic,"['firebase', 'google-bigquery', 'firebase-analytics']",235,True,0,1
Counting number of text views within a framelayout,"<p>I am new to espresso UI testing and trying to count the number of text views displays in a particular screen in the app. I tried something like the following</p>

<pre><code>onView(allOf(withId(R.id.listview),
    isDescendantOfA(withId(R.id.framelayout))
            .check(ViewAssertions.matches (Matchers.withListSize (2)))))
</code></pre>

<p>with the following custom matcher</p>

<pre><code>class Matchers {
  public static Matcher&lt;View&gt; withListSize (final int size) {
    return new TypeSafeMatcher&lt;View&gt; () {
      @Override public boolean matchesSafely (final View view) {
        return ((ListView) view).getCount () == size;
      }

      @Override public void describeTo (final Description description) {
        description.appendText (""ListView should have "" + size + "" items"");
      }
    };
  }
}
</code></pre>

<p>I tried the one mentioned here, <a href=""https://stackoverflow.com/questions/39349395/espresso-count-elements"">Espresso count elements</a> doesn't work with the latest version.</p>
",https://stackoverflow.com/questions/55624431/counting-number-of-text-views-within-a-framelayout,"['android', 'android-espresso']",209,False,1,0
How to add Unit Tests for Apple Watch in Xcode?,"<p>1.Does watchOS (as of watchOS 4.3) currently support unit or UI testing? There is no UI Test Case Class file and Unit Test Case Class file in the watchOS file.</p>

<p>2.If watchOS supports unit testing, can we place the Unit Test Case file of watchOS in the iOS Unit Test Case file?</p>
",https://stackoverflow.com/questions/54338305/how-to-add-unit-tests-for-apple-watch-in-xcode,"['unit-testing', 'watchkit', 'watchos']",733,False,3,1
karate chrome(chromium-browser) driver configuration,"<p>I need to launch a url for UI testing in a KarateDSL scenario.</p>

<p>I have configured, in <code>Feature -&gt; Background</code>:</p>

<pre><code>* configure driver = { type: 'chrome', executable: 'chromesh' }
</code></pre>

<p>Where, <code>chromesh</code> is a executable (chromium-browser launching) bash script in <code>~/.local/bin</code>.</p>

<p>At run it always seems to be using the default driver config:</p>

<pre><code>18:38:09.781 [null_1552396089768] ERROR c.intuit.karate.shell.CommandThread - command error: [/Applications/Google Chrome.app/Contents/MacOS/Google Chrome, --remote-debugging-port=9222, --no-first-run, --user-data-dir=/home/../target/null_1552396089768, --headless] - Cannot run program ""/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"" (in directory ""target/null_1552396089768""): error=2, No such file or directory
</code></pre>

<p>Karate version: 0.9.1</p>

<p>Is there any configuration I'm missing or done wrong?</p>

<p>Thanks.</p>
",https://stackoverflow.com/questions/55122497/karate-chromechromium-browser-driver-configuration,"['integration-testing', 'karate']",1130,True,1,1
Mockito when starts actual method call Android UI Testing,"<p>We have a <code>Configuration</code> class and <code>LocalStorage</code> class Configuration takes LocalStorage instance in constructor, LocalStorage takes <code>Context</code> in constructor. We are just trying to start with UI testing.
We are trying to do this</p>

<pre><code>   private val localStorage = Mockito.mock(LocalStorage::class.java)

   // in our setup method
   Mockito.`when`(localStorage.getString(anyString())).thenReturn(str)
</code></pre>

<p>Here problem is that <code>getString()</code> method call starts happening immediately when tests are run. We have not even written actual test yet. </p>

<p>Mockito Android version: 3.1.0</p>
",https://stackoverflow.com/questions/58709277/mockito-when-starts-actual-method-call-android-ui-testing,"['android', 'mockito', 'android-espresso', 'android-testing']",267,False,2,3
How to make a test in Espresso that checks a string that contains HTML tag?,"<p>I am doing some UI testing on an android Fragment and I have the following string in my code:</p>

<pre><code>textView.text = Html.fromHtml(""$updateText &lt;u&gt;Change&lt;/u&gt;?"")
</code></pre>

<p>And in my test I have this code:</p>

<pre><code>recoverPasswordAssert{

    checkTextIsVisible(""Number format. Change?"")
}
</code></pre>

<p>When I run the test this error happens:</p>

<pre><code>androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with text: is ""Number format. Change?""
</code></pre>

<p>I think it's missing the HTML tag from the fragment code, but how to get the tag in the Espresso test?</p>
",https://stackoverflow.com/questions/58606867/how-to-make-a-test-in-espresso-that-checks-a-string-that-contains-html-tag,"['android', 'html', 'testing', 'automated-tests', 'android-espresso']",668,True,1,1
Is it possible to click every element on a page with dynamic content?,"<p>Is it possible with puppeteer to go to a website, test if every content on the page is clickable/links working and all this with dynamic content, so I can automate my UI-Testing?</p>

<p>The problem is, that the content is changing and not every element has an id but I still want every element checked for an page.</p>
",https://stackoverflow.com/questions/55948907/is-it-possible-to-click-every-element-on-a-page-with-dynamic-content,"['javascript', 'node.js', 'css-selectors', 'puppeteer']",815,True,1,1
Simulating Mouse movement and dragging in a UWP application with Appium?,"<p>I am trying to write some highly customized UI testing code for windows UWP apps.  I am using Appium and so far I am able to simulate a click with this code just fine:</p>

<pre><code>var item = _session.FindElementByAccessibilityId(""my_page"") as WindowsElement;
item.Click();
</code></pre>

<p>The <code>WindowsElement</code> does not appear to expose a way to click and drag from point to point.  Is there a way to accomplish this? </p>
",https://stackoverflow.com/questions/58920919/simulating-mouse-movement-and-dragging-in-a-uwp-application-with-appium,"['windows', 'selenium', 'uwp', 'appium']",1631,True,1,2
Flutter testing - forms,"<p>I have tried testing in flutter with <strong>flutter_test</strong> and <strong>flutter_driver</strong>. Able to achieve UI testing with tap functions. But my requirement is to test forms end to end(i.e automatically fill forms). Facing issue with <strong>driver.enterText()</strong>, its not getting executed and the test cases stops executing from here.</p>

<p>Below is the code that i have tried :</p>

<pre><code>test('Going back to customers tab', () async {
      // First, tap the button.
      final customerTabFinder = find.text('Customers');
      await driver.waitFor(customerTabFinder);
      await driver.tap(customerTabFinder);
      await driver.getText(find.text(""Customer""));
      await takeScreenshot(driver, 'screenshots/incremented1.png');
    });

    test(""Adding customers"", () async {
      final pressAddCustomerButton = find.byTooltip(""Increment"");

      await driver.waitFor(pressAddCustomerButton);
      await driver.tap(pressAddCustomerButton);
      print(""Add customer page is opened"");
    });

    test(""Adding text in textfield"", () async {
      await driver.tap(find.byValueKey(""CustomerBusinessName""));
      await sleep(Duration(seconds: 5));
      await driver.enterText('Hello !');

      await driver.tap(find.byValueKey(""CustomerPhoneNumber""));
      await driver.enterText('1234567890');
    });
</code></pre>
",https://stackoverflow.com/questions/58796911/flutter-testing-forms,['flutter-test'],2965,True,1,2
Assertj Mouse clicking is working only if the windows display resolution lowered to 1366X768,"<p>Mouse clicking is working only when the windows display resolution is lowered during automated UI test using assertj. Is there a way to click with the default resolution?</p>

<p>I tried setting the preferred size of the top JFrame but still does not help</p>

<pre><code>frame.setPreferredSize(new Dimension(1360, 768));
frame.setResizable(true);
</code></pre>

<p>example:</p>

<pre><code>    public static void main(String[] args) {
        JFrame fr = new JFrame(""exampleCheckbox"");
        fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel panel = new JPanel();
        JCheckBox exampleCheckbox = new JCheckBox(""exampleCheckbox"", true);
        panel.setBorder(BorderFactory.createTitledBorder(""checkbox""));
        panel.add(exampleCheckbox);
        fr.add(panel);
    }
</code></pre>

<pre><code>@Test
public void testCheckboxUISelectEventTest( )   {
FrameFixture window = new FrameFixture (fr);
window.checkBox(""exampleCheckBox"").click();
}
</code></pre>

<p>mouse clicking for automated UI testing should work with default windows resolution</p>
",https://stackoverflow.com/questions/57460599/assertj-mouse-clicking-is-working-only-if-the-windows-display-resolution-lowered,"['java', 'swing', 'awt', 'awtrobot', 'assertj']",61,False,0,0
Xcode UI Testing plan,"<p>I would like to implement UI Testing for my app, but I couldn't find anywhere some guides on how to structure the tests, group them or which is the best way to proceed writing the tests - a big flow in a test, or multiple tests for smaller flows.
If you have some resources regarding these topics, any help would be appreciated.</p>

<p>Thank you!</p>
",https://stackoverflow.com/questions/56803682/xcode-ui-testing-plan,"['ios', 'user-interface', 'testing', 'architecture', 'ui-automation']",242,True,1,2
Post result to external api after each test case,"<p>I'm setting up a CI-chain and decided to use Cypress for the UI testing. I need to get the result for each individual testcase in my suite. Preferably from within Node in for example a afterEach statement.</p>

<p>Has anyone done this before? Is there any built-in support for this?</p>

<p>I do not want to parse the end result for testcases preferably.</p>
",https://stackoverflow.com/questions/55951636/post-result-to-external-api-after-each-test-case,['cypress'],206,True,0,1
where to place the chromedriver in aws lambda,"<p>I am working in a web scraping project with python 3.7.
 Done the code in python with selenium and chromediver.exe in windows, it's working fine.
 we are adding the script in aws lambda. 
 the issue is we need to specify the chrome driver of Linux.</p>

<p>I followed the steps in <a href=""https://github.com/yai333/Selenium-UI-testing-with-AWS-Lambda-Layers"" rel=""nofollow noreferrer"">https://github.com/yai333/Selenium-UI-testing-with-AWS-Lambda-Layers</a>.</p>

<p>i am not using any serverless yml sript(i don't know the same).
doing the following</p>

<p>we have a Linux machine. 
create a virtual python environment and add selenium module(as described in awshttps://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#python-package-venv)
download chromdriver and headless into a folder(size is large, so upload to S3) add both (chrome driver and python lib) as layers.
paste the handler.py (in <a href=""https://github.com/yai333/Selenium-UI-testing-with-AWS-Lambda-Layers"" rel=""nofollow noreferrer"">https://github.com/yai333/Selenium-UI-testing-with-AWS-Lambda-Layers</a>) to a lambdahandler file.
create a sample test, and click on test.
shows error:
error message 'chromedriver' executable needs to be in path</p>

<p>can I upload chrome driver in S3 and show the path.</p>
",https://stackoverflow.com/questions/58076730/where-to-place-the-chromedriver-in-aws-lambda,"['python', 'selenium-chromedriver']",2984,True,3,1
How to run Android UI Tests and pass arguments to the App/Activity,"<p>I want to run UI tests for Android app with some predefined data which will vary depending on the test case. In iOS, it's possible to pass arguments to the tested app like this:</p>

<pre><code>app = XCUIApplication()
app.reset()
app.launchArguments += [""--myArgument""]
app.launch()
</code></pre>

<p>These arguments are later available inside the app process.</p>

<p>Is there something similar for Android UI testing? Best way would to access these arguments via intent's extras.</p>

<pre><code>getIntent().getExtras().getString(key)
</code></pre>

<p>Thanks for help!</p>
",https://stackoverflow.com/questions/58993803/how-to-run-android-ui-tests-and-pass-arguments-to-the-app-activity,"['android', 'testing', 'android-espresso']",1436,True,2,4
Testing a fragment that uses bottom navigation view of a parent activity,"<p>I am trying to do some UI testing in isolation  on some fragments that uses a shared Bottom navigation view from MainActivity, basically used to navigate and to scroll up and down, but my tests fails with nullpointerException basically because the buttons inside the bottom navigation view are not found in the fragment layout.
My question is how to pass these layouts belonging to mainactivity to the fragmentTest class.</p>
",https://stackoverflow.com/questions/59472357/testing-a-fragment-that-uses-bottom-navigation-view-of-a-parent-activity,"['android', 'testing', 'fragment', 'bottomnavigationview', 'uitest']",893,True,1,1
How to enable code coverage for web service code written in java and angular,"<p>Any hint will be appreciated.  </p>

<p><strong>P1:</strong> I have microservice with spring boot project, code with java and angular.<br>
<strong>P1.testing:</strong> Selenium code for UI testing with java.</p>

<p><strong>For reference:</strong> My project name is P1 and testing project is P1.testing.  </p>

<p>Now i want to enable code coverage for P1. Which tool i can use to do same?</p>

<p>How i can include code of P1 in my testing project to enable code coverage?</p>
",https://stackoverflow.com/questions/59475491/how-to-enable-code-coverage-for-web-service-code-written-in-java-and-angular,"['java', 'angular', 'code-coverage']",146,False,2,1
Xamarin forms testing layout,"<pre class=""lang-cs prettyprint-override""><code>var child = new Frame();
var relativeLayout = new RelativeLayout();
relativeLayout.Children.Add(child, Constraint.RelativeToParent(r =&gt; 42));

var x = child.X;

x.Should().Be(42);
</code></pre>

<p>I'm trying to test some logic related to the position of elements in my Xamarin Forms app. The problem is that <code>x</code> is 0 in this case, but in the running App, it is 42.
I know there is the concept of UI-testing, but I would not like to go down that road just yet. </p>

<p>Is there some way of forcing layout in the tests?</p>

<p>In WPF you can do <code>.Measure</code> and <code>.Arrange</code> to place items correctly.</p>
",https://stackoverflow.com/questions/58956711/xamarin-forms-testing-layout,"['c#', 'unit-testing', 'xamarin', 'layout', 'xamarin.forms']",72,False,1,0
Kotlin compile &quot;ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.&quot; but no kotlin_version in build.gradle?,"<p>I tried cloning and building this project, <a href=""https://github.com/mitrejcevski/ui-testing"" rel=""noreferrer"">https://github.com/mitrejcevski/ui-testing</a>, but upon opening it in Android Studio, I get the following build error:</p>

<pre><code>ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
root project 'ui-testing' -&gt; org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.21
Affected Modules: app
</code></pre>

<p>However, when I click the 'app' hyperlink I am led to the module-level <code>build.gradle</code> file, which reads</p>

<pre><code>apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId ""nl.jovmit""
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName ""1.0""
        testInstrumentationRunner ""android.support.test.runner.AndroidJUnitRunner""
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    productFlavors {
        mock {
            flavorDimensions ""default""
        }
        prod {
            flavorDimensions ""default""
        }
    }

    android.variantFilter { variant -&gt;
        if (variant.buildType.name == 'release' &amp;&amp; variant.getFlavors().get(0).name == 'mock') {
            variant.setIgnore(true)
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation ""org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version""
    implementation ""com.android.support:appcompat-v7:$support_version""
    implementation ""com.android.support:design:$support_version""
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'

    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    testImplementation 'junit:junit:4.12'
}
</code></pre>

<p>Unlike the accepted answer of <a href=""https://stackoverflow.com/questions/54605954/error-the-android-gradle-plugin-supports-only-kotlin-gradle-plugin-version-1-3"">ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher</a>, I don't see any <code>ext.kotlin_version</code> anywhere in the Gradle file.</p>

<p>I do see this warning, though, that <code>kotlin-stdlib-jre7</code> is deprecated:</p>

<p><a href=""https://i.stack.imgur.com/yypLl.png"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/yypLl.png"" alt=""enter image description here""></a></p>

<p>However, I tried changing this but still get the same error. I've also tried adding the line</p>

<pre><code>implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'
</code></pre>

<p>to <code>dependencies</code> (as seen in the screenshot above), but that also didn't prevent the error.</p>

<p>Any idea how to fix this? I suspect that the outdated Kotlin version is a 'sub-dependency' of one of the dependencies here, but haven't been able to figure out which one.</p>
",https://stackoverflow.com/questions/54858510/kotlin-compile-error-the-android-gradle-plugin-supports-only-kotlin-gradle-plu,"['android', 'gradle', 'kotlin']",80043,True,44,15
How do you write UI tests for a command line app in Xcode?,"<p>I'm making a small Zork-type game, and I don't want to have to type my way through the whole thing to test the game play every time I change something. Is there a way to use UI testing to do it for me?</p>

<p>I've tried looking around, but everyone just talks about running UI tests <em>from</em> the command line. But, I'd like to know how to do it <em>for</em> a console app.</p>
",https://stackoverflow.com/questions/54468917/how-do-you-write-ui-tests-for-a-command-line-app-in-xcode,"['xcode', 'macos', 'xcode-ui-testing']",46,False,0,1
Is it possible to mock the result of a function triggered by a button click with testcafe/node?,"<p>Is it possible to mock the result of a function triggered by a button click with testcafe/node for UI testing? Selenium/capybara has the 'allow_any_instance_of(...).to receive(..) syntax.</p>

<p>So the router receives ""choice"" from the body and instantiates a new Game - I want to mock the random argument function given to the Game. I have already mocked random when testing the Game model but want to also mock the result on the user interface using Testcafe.</p>

<pre><code>router.post('/', function(req, res, next) {
  let choice = req.body.choice,
  game = new Game( choice, random ),
  houseChoice = '',
  result = game.calcWinner( random );
  houseChoice = game.houseChoice;
  res.render('rps', { choice: choice,
                      first_name: first_name,
                      last_name: last_name,
                      random: houseChoice,
                      result: result });
});
</code></pre>
",https://stackoverflow.com/questions/54441831/is-it-possible-to-mock-the-result-of-a-function-triggered-by-a-button-click-with,"['node.js', 'testing', 'automated-tests', 'e2e-testing', 'testcafe']",463,True,2,2
Web Element sendKeys() adds an extra character no matter what string I pass. How to fix?,"<p>I am working in with Selenium 3.14 in java to do UI testing on a login page. My code is trying to send values to an input element named password. Which is the field to input a password. Passing in ""1111"" will output a five digit string into the input field. It was working fine before but now it won't work at all. </p>

<p><code>value=""1111""
browser.findElement(passwordElement).sendKeys(value);</code></p>

<p>My output is some 5 character string. But the length should be 4</p>
",https://stackoverflow.com/questions/55543374/web-element-sendkeys-adds-an-extra-character-no-matter-what-string-i-pass-how,"['java', 'selenium-webdriver']",250,True,0,1
How to compare two images and highlight the difference in new image in flutter?,"<p>I am a flutter developer. My need is to compare two images and highlight the difference (between two images) in a new image in flutter?</p>

<p>Two images <strong>First image</strong> and <strong>Second image</strong>. </p>

<p>My requirement is to compare those images and highlight the difference region in another image <strong>Difference image</strong>. I am trying to achieve screenshot based UI testing in flutter and need to fail the test cases if there is any differences between two images.</p>

<p>Please find the below screenshots for reference.</p>

<p><a href=""https://i.stack.imgur.com/EQmkL.png"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/EQmkL.png"" alt=""enter image description here""></a></p>

<p>Is there any package in flutter/dart to achieve the same output? </p>

<p>Thanks and regards,</p>

<p>Ashwin</p>
",https://stackoverflow.com/questions/57413108/how-to-compare-two-images-and-highlight-the-difference-in-new-image-in-flutter,"['flutter', 'dart']",5468,True,13,3
"A few cypress pipelines are always hanging, one cypress pipeline is always pass","<p><a href=""https://i.stack.imgur.com/4zzpU.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/4zzpU.png"" alt=""enter image description here""></a>In Gitlab there is a pipeline for UI testing (with three jobs written with cypress) that triggered after each push to project.
When a few pushes are done - is where the problem begins. The cypress pipelines are pending one after another and then the second pipeline is always hanging!
If I run one cypress pipeline no problem occurs, everything is fine.
What could be the reason?</p>

<pre><code>Error: Cypress command timeout of '120000ms' exceeded.

Because this error occurred during a 'after each' hook we are skipping the remaining tests in the current suite: 'page_1'
</code></pre>

<p>This is the test that stuck, but I think that problem is related to gitlab runners. 
<a href=""https://i.stack.imgur.com/90dbf.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/90dbf.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/55401213/a-few-cypress-pipelines-are-always-hanging-one-cypress-pipeline-is-always-pass,"['javascript', 'continuous-integration', 'gitlab', 'cypress']",272,False,2,0
"Can we edit maxDepth in Firebase robotest. If yes, how?","<p>I am trying to automate the ""UI testing"" for my android application by using firebase testlab. I have saved a script in android studio but want to limit the robot for any further monkey testing. All it does is after my sctipts runs successfully, it starts doing monkey testing, which is of no use to me. </p>

<p>I read it online it can be controlled using ""maxDepth"" but couldn't find anything more. Would appreciate if someone could help me implement this.  </p>
",https://stackoverflow.com/questions/54090053/can-we-edit-maxdepth-in-firebase-robotest-if-yes-how,"['android', 'firebase', 'firebase-test-lab']",48,True,1,1
Run selenium tests (chrome) in AWS Lambda - NET Core,"<p>Trying to run selenium tests in AWS Lambda. Read below links and felt confident to implement similar tests with NET Core 2.1.</p>

<ul>
<li><a href=""https://blackboard.github.io/lambda-selenium/"" rel=""nofollow noreferrer"">https://blackboard.github.io/lambda-selenium/</a></li>
<li><a href=""https://medium.com/clog/running-selenium-and-headless-chrome-on-aws-lambda-fb350458e4df"" rel=""nofollow noreferrer"">https://medium.com/clog/running-selenium-and-headless-chrome-on-aws-lambda-fb350458e4df</a></li>
<li><a href=""https://aws.amazon.com/blogs/devops/ui-testing-at-scale-with-aws-lambda/"" rel=""nofollow noreferrer"">https://aws.amazon.com/blogs/devops/ui-testing-at-scale-with-aws-lambda/</a></li>
</ul>

<p>Here is my complete lambda function code.</p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.IO;
    using Amazon.Lambda.Core;
    using OpenQA.Selenium;
    using OpenQA.Selenium.Chrome;

    // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]

namespace selenium_lambda_poc1
{
    public class Function
    {

        /// &lt;summary&gt;
        /// A simple function that takes a string and does a ToUpper
        /// &lt;/summary&gt;
        /// &lt;param name=""input""&gt;&lt;/param&gt;
        /// &lt;param name=""context""&gt;&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        public void FunctionHandler(string input, ILambdaContext context)
        {
            context.Logger.LogLine(""Starting..."");
            var driver = GetDriver(context);
            driver.Navigate().GoToUrl(input);
            var title = driver.Title;
            LambdaLogger.Log(""Window Title: "" + title);
            driver.Quit();
            context.Logger.LogLine(""Ending..."");
        }

        public IWebDriver GetDriver(ILambdaContext context)
        {
            var lambdaTaskRootPath = Environment.GetEnvironmentVariable(""LAMBDA_TASK_ROOT"");
            context.Logger.LogLine(lambdaTaskRootPath);
            Environment.SetEnvironmentVariable(""webdriver.chrome.driver"", lambdaTaskRootPath + @""/Lib/chromedriver"");

            ChromeOptions options = new ChromeOptions();
            options.BinaryLocation = lambdaTaskRootPath + ""/Lib/chrome"";
            var chromeBinaryPath = options.BinaryLocation;
            var chromeDriverPath = lambdaTaskRootPath + @""/Lib/chromedriver"";

            context.Logger.LogLine(""Chrome Path? "" + chromeBinaryPath);
            context.Logger.LogLine(""ChromeDriver Path? "" + chromeDriverPath);
            context.Logger.LogLine(""Chrome - Available? "" + File.Exists(chromeBinaryPath).ToString());
            context.Logger.LogLine(""ChromeDriver - Available? "" + File.Exists(chromeDriverPath).ToString());


            options.AddArguments(new List&lt;string&gt;() {
                ""--headless"",
                ""--disable-gpu"",
                ""--single-process"",
                ""--no-sandbox"",
                ""--data-path=/tmp/data-path"",
                ""--homedir=/tmp/homedir"",
                ""--disk-cache-dir=/tmp/cache-dir"",
                ""--allow-file-access-from-files"",
                ""--disable-web-security"",
                ""--disable-extensions"",
                ""--ignore-certificate-errors"",
                ""--disable-ntp-most-likely-favicons-from-server"",
                ""--disable-ntp-popular-sites"",
                ""--disable-infobars"",
                ""--disable-dev-shm-usage"",
                ""--window-size=1366,1024"",
                ""--enable-logging""
            });

            var driver = new ChromeDriver(lambdaTaskRootPath + ""/Lib/"", options, TimeSpan.FromMinutes(1));
            return driver;
        }
    }
}
</code></pre>

<p>When I test my lambda function, getting the below and I've been struggling with same issue for the last 3 days. Would be grateful if someone can help me out here</p>

<pre><code>Starting ChromeDriver 2.39.562737 (dba483cee6a5f15e2e2d73df16968ab10b38a2bf) on port 38471
Only local connections are allowed.
The HTTP request to the remote WebDriver server for URL http://127.0.0.1:38471/session timed out after 60 seconds.: WebDriverException
at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at selenium_lambda_poc.Function.GetDriver(ILambdaContext context) in C:\Users\sureshraja.s\source\repos\selenium-lambda-poc\selenium-lambda-poc\Function.cs:line 97
at selenium_lambda_poc.Function.FunctionHandler(String input, ILambdaContext context) in C:\Users\sureshraja.s\source\repos\selenium-lambda-poc\selenium-lambda-poc\Function.cs:line 34

at System.Net.HttpWebRequest.GetResponse()
at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
</code></pre>
",https://stackoverflow.com/questions/56181804/run-selenium-tests-chrome-in-aws-lambda-net-core,"['amazon-web-services', 'selenium-webdriver', 'aws-lambda', 'asp.net-core-2.1', 'amazon-linux']",1158,False,3,0
How to enable WebView for a Cordova Mobile App?,"<p>When I get context handles from code, I only see ""Native"". How do I enable WebView for a Cordova Mobile App (Hybrid). Is there a setting in project files that enables the WebView ? Please advise.</p>

<p>Unable to find a setting that sets the WebView = true</p>

<p>I am trying to get context handles for this Hybrid Mobile App ( Cordova ) and I see only native. I need to be able to get WebView to interact with the mobile elements for UI testing using Appium.</p>
",https://stackoverflow.com/questions/58495149/how-to-enable-webview-for-a-cordova-mobile-app,"['java', 'cordova', 'android-webview', 'hybrid-mobile-app']",175,False,0,0
Azure DevOps Git UI Automation same repo or seperate,"<p>I am working on setting up Azure DevOps Git Repo, Build and Release pipelines. </p>

<p>We have separate team members responsible for development of application and separate responsible for UI test automation. </p>

<p>My question is should I have </p>

<p>a) one repo for the Application Code and Integration UI testing with single build pipeline building everything and single release pipeline deploying and running UI tests</p>

<p>b) Have two separate repos for application and UI Tests and two separate builds and release pipelines?</p>

<p>If you have experience in setting this up which one is preferred method and why?</p>
",https://stackoverflow.com/questions/57193977/azure-devops-git-ui-automation-same-repo-or-seperate,"['git', 'azure-devops', 'pipeline', 'ui-testing', 'azure-git-deployment']",386,True,3,2
"When running Kotlin Unit and UI tests, 1 or 2 new tests are failing everything time","<p>I am trying to run both unit and UI testing in Kotlin using Junit and Espresso. 
What is really interesting is that everytime I run the entire test, 1 or 2 new tests are failing. 
It seems that there is a systematic glitch in my test settings. What would be the cause of this issue? Any suggestions where i should begin debugging?</p>

<p>Test Setting:</p>

<pre><code>// Build.gradle
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation ""org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version""
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation ""androidx.recyclerview:recyclerview:1.0.0""
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
    implementation 'androidx.navigation:navigation-fragment:2.0.0'
    implementation 'androidx.navigation:navigation-ui:2.0.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0'
    implementation 'androidx.navigation:navigation-ui-ktx:2.0.0'
    implementation 'androidx.room:room-runtime:2.1.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
    kapt 'androidx.room:room-compiler:2.1.0'

    // test implementation
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.powermock:powermock-module-junit4:1.7.4'
    testImplementation 'org.powermock:powermock-api-mockito2:1.7.4'

    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test:rules:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'

    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup.retrofit2:retrofit:2.6.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
}
</code></pre>

<p>Several types of error message that I am facing in this issue:</p>

<p>type 1: </p>

<pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
    Process: xyz.hitit.userapplication.debug, PID: 11286
    java.lang.IllegalStateException: pwdEditText must not be null
        at xyz.hitit.userapplication.ui.registrationLogin.PasswordLoginFragment$onCreateView$1$1$1.run(PasswordLoginFragment.kt:72)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/MonitoringInstr: Exception encountered by: Thread[main,5,main]. Dumping thread state to outputs and pining for the fjords.
    java.lang.IllegalStateException: pwdEditText must not be null
        at xyz.hitit.userapplication.ui.registrationLogin.PasswordLoginFragment$onCreateView$1$1$1.run(PasswordLoginFragment.kt:72)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
</code></pre>

<p>type 2: </p>

<pre><code>androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (Child at position 1 in parent (with id: xyz.hitit.userapplication.debug:id/design_navigation_view and Child at position 0 in parent with id: xyz.hitit.userapplication.debug:id/nav_view) and is displayed on the screen to the user)

View Hierarchy:
+&gt;DecorView{id=-1, visibility=VISIBLE, width=1080, height=2160, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params={(0,0)(fillxfill) ty=BASE_APPLICATION wanim=0x10302fe
fl=LAYOUT_IN_SCREEN LAYOUT_INSET_DECOR SPLIT_TOUCH HARDWARE_ACCELERATED DRAWS_SYSTEM_BAR_BACKGROUNDS
pfl=FORCE_DRAW_STATUS_BAR_BACKGROUND}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}
|
+-&gt;LinearLayout{id=-1, visibility=VISIBLE, width=1080, height=2028, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@cf89f9f, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}
(133 more lines...)
</code></pre>

<p>type 3: </p>

<pre><code>androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with text: is ""randomTextToShowXButton""' doesn't match the selected view.
Expected: with text: is ""randomTextToShowXButton""
Got: ""ClearEditText{id=2131230812, res-name=emailEditText, visibility=VISIBLE, width=938, height=132, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=true, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@bbfd43f, tag=null, root-is-layout-requested=false, has-input-connection=true, editor-info=[inputType=0x21 imeOptions=0x6 privateImeOptions=null actionLabel=null actionId=0 initialSelStart=19 initialSelEnd=19 initialCapsMode=0x0 hintText=youremail@email.com label=null packageName=null fieldId=0 fieldName=null extras=null hintLocales=null contentMimeTypes=null ], x=71.0, y=572.0, text=randomTextToShowXBu, hint=youremail@email.com, input-type=33, ime-target=true, has-links=false}""

at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:1720)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:96)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59)
(51 more lines...)
</code></pre>

<p>type 4: </p>

<pre><code>java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at androidx.fragment.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:2080)
at androidx.fragment.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2106)
at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:683)
at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:637)
at xyz.hitit.userapplication.ui.registrationLogin.RegisterLoginActivity$onCreate$1.invoke(RegisterLoginActivity.kt:42)
at xyz.hitit.userapplication.ui.registrationLogin.RegisterLoginActivity$onCreate$1.invoke(RegisterLoginActivity.kt:14)
at xyz.hitit.api.methods.OAuth$requestJWTClientCredentials$1.onResponse(OAuth.kt:37)
(8 more lines...)
</code></pre>
",https://stackoverflow.com/questions/58281306/when-running-kotlin-unit-and-ui-tests-1-or-2-new-tests-are-failing-everything-t,"['android', 'android-studio', 'kotlin']",121,False,0,0
Not able to run PhantomJS UI test through remote selenium webdriver,"<p>I am trying to use phantomJS through remote webdriver for UI testing. Here are the steps I have followed:</p>

<p><strong>Phantom JS:</strong></p>

<p>I have downloaded windows version from here because of an issue:
<a href=""https://github.com/mrorgues/PhantomJSCustomEdition/tree/builds"" rel=""nofollow noreferrer"">https://github.com/mrorgues/PhantomJSCustomEdition/tree/builds</a></p>

<p><strong>Selenium Hub:</strong></p>

<pre><code>java -jar  selenium-server-standalone-3.14.0.jar -role hub
</code></pre>

<p><strong>Phantom JS Node:</strong></p>

<pre><code>phantomjs --webdriver=7777 --webdriver-selenium-grid-hub=http://127.0.0.1:4444
</code></pre>

<p>When I am trying to access the hub through the URL I see this which is good:</p>

<p><a href=""https://i.stack.imgur.com/O4Xa2.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/O4Xa2.png"" alt=""enter image description here""></a></p>

<p>This is how I am initializing driver for running my tests: </p>

<pre><code>DesiredCapabilities capabilities = DesiredCapabilities.phantomjs();
String urlString = ""http://HubHostName:4444/wd/hub"";
WebDriver driver = new RemoteWebDriver(new URL(urlString), capabilities);
</code></pre>

<p>I have also tried this:</p>

<pre><code>DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(""browserName"",""phantomjs"");
String urlString = ""http://HubHostName:4444/wd/hub"";
WebDriver driver = new RemoteWebDriver(new URL(urlString), capabilities);
</code></pre>

<p>But I am always getting the below error:</p>

<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-html lang-html prettyprint-override""><code>&lt;html&gt;
&lt;head&gt;
    &lt;meta http-equiv=""Content-Type"" content=""text/html;charset=utf-8""/&gt;
    &lt;title&gt;Error 500 Server Error&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;&lt;h2&gt;HTTP ERROR 500&lt;/h2&gt;
    &lt;p&gt;Problem accessing /wd/hub/session. Reason:
    &lt;pre&gt;    Server Error&lt;/pre&gt;&lt;/p&gt;&lt;h3&gt;Caused by:&lt;/h3&gt;&lt;pre&gt;java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
      &amp;quot;desiredCapabilities&amp;quot;: {
        &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
      },
      &amp;quot;requiredCapabilities&amp;quot;: {},
      &amp;quot;capabilities&amp;quot;: {
        &amp;quot;desiredCapabilities&amp;quot;: {
          &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
        },
        &amp;quot;requiredCapabilities&amp;quot;: {},
        &amp;quot;alwaysMatch&amp;quot;: {
          &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
        },
        &amp;quot;firstMatch&amp;quot;: []
      }
    }
    	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:138)
    	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:69)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:860)
    	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    	at org.seleniumhq.jetty9.security.SecurityHandler.handle(SecurityHandler.java:548)
    	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
    	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
    	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
    	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
    	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.seleniumhq.jetty9.server.Server.handle(Server.java:530)
    	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:347)
    	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:256)
    	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:102)
    	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    	at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
    	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
    	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
      &amp;quot;desiredCapabilities&amp;quot;: {
        &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
      },
      &amp;quot;requiredCapabilities&amp;quot;: {},
      &amp;quot;capabilities&amp;quot;: {
        &amp;quot;desiredCapabilities&amp;quot;: {
          &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
        },
        &amp;quot;requiredCapabilities&amp;quot;: {},
        &amp;quot;alwaysMatch&amp;quot;: {
          &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
        },
        &amp;quot;firstMatch&amp;quot;: []
      }
    }
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:76)
    	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.&amp;lt;init&amp;gt;(SeleniumBasedRequest.java:102)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.&amp;lt;init&amp;gt;(WebDriverRequest.java:36)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30)
    	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:73)
    	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
    	... 32 more
    Caused by: java.lang.IllegalArgumentException: First match w3c capabilities is zero length
    	at org.openqa.selenium.remote.NewSessionPayload.validate(NewSessionPayload.java:164)
    	at org.openqa.selenium.remote.NewSessionPayload.&amp;lt;init&amp;gt;(NewSessionPayload.java:149)
    	at org.openqa.selenium.remote.NewSessionPayload.create(NewSessionPayload.java:104)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:66)
    	... 37 more
    &lt;/pre&gt;
    &lt;h3&gt;Caused by:&lt;/h3&gt;&lt;pre&gt;org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
      &amp;quot;desiredCapabilities&amp;quot;: {
        &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
      },
      &amp;quot;requiredCapabilities&amp;quot;: {},
      &amp;quot;capabilities&amp;quot;: {
        &amp;quot;desiredCapabilities&amp;quot;: {
          &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
        },
        &amp;quot;requiredCapabilities&amp;quot;: {},
        &amp;quot;alwaysMatch&amp;quot;: {
          &amp;quot;browserName&amp;quot;: &amp;quot;phantomjs&amp;quot;
        },
        &amp;quot;firstMatch&amp;quot;: []
      }
    }
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:76)
    	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.&amp;lt;init&amp;gt;(SeleniumBasedRequest.java:102)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.&amp;lt;init&amp;gt;(WebDriverRequest.java:36)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30)
    	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:73)
    	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
    	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:69)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:860)
    	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    	at org.seleniumhq.jetty9.security.SecurityHandler.handle(SecurityHandler.java:548)
    	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
    	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
    	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
    	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
    	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.seleniumhq.jetty9.server.Server.handle(Server.java:530)
    	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:347)
    	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:256)
    	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:102)
    	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    	at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
    	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
    	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.IllegalArgumentException: First match w3c capabilities is zero length
    	at org.openqa.selenium.remote.NewSessionPayload.validate(NewSessionPayload.java:164)
    	at org.openqa.selenium.remote.NewSessionPayload.&amp;lt;init&amp;gt;(NewSessionPayload.java:149)
    	at org.openqa.selenium.remote.NewSessionPayload.create(NewSessionPayload.java:104)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:66)
    	... 37 more
    &lt;/pre&gt;
    &lt;h3&gt;Caused by:&lt;/h3&gt;&lt;pre&gt;java.lang.IllegalArgumentException: First match w3c capabilities is zero length
    	at org.openqa.selenium.remote.NewSessionPayload.validate(NewSessionPayload.java:164)
    	at org.openqa.selenium.remote.NewSessionPayload.&amp;lt;init&amp;gt;(NewSessionPayload.java:149)
    	at org.openqa.selenium.remote.NewSessionPayload.create(NewSessionPayload.java:104)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:66)
    	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.&amp;lt;init&amp;gt;(SeleniumBasedRequest.java:102)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequest.&amp;lt;init&amp;gt;(WebDriverRequest.java:36)
    	at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30)
    	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:73)
    	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
    	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:69)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:860)
    	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    	at org.seleniumhq.jetty9.security.SecurityHandler.handle(SecurityHandler.java:548)
    	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
    	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
    	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
    	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
    	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.seleniumhq.jetty9.server.Server.handle(Server.java:530)
    	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:347)
    	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:256)
    	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:102)
    	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
    	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    	at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
    	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
    	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
    	at java.lang.Thread.run(Unknown Source)
    &lt;/pre&gt;
    &lt;hr&gt;&lt;a href=""http://eclipse.org/jetty""&gt;Powered by Jetty:// 9.4.8.v20180619&lt;/a&gt;&lt;hr/&gt;
    
    &lt;/body&gt;
    &lt;/html&gt;</code></pre>
</div>
</div>
</p>
",https://stackoverflow.com/questions/55385166/not-able-to-run-phantomjs-ui-test-through-remote-selenium-webdriver,"['selenium', 'selenium-webdriver', 'automation', 'phantomjs', 'remotewebdriver']",97,False,0,0
How can I access the window object in Nightwatch while the test is running?,"<p>I am UI testing an application containing OpenLayers. Since OpenLayers is for the most part drawing an SVG, directly testing effects via DOM is not always possible.</p>

<p>I would like to get the map object to check if the variables within it are set correctly after clicking an element outside of the map.</p>

<p>For this I put the map object in window.mapInstance.</p>

<p>During a test, I try this:</p>

<pre class=""lang-js prettyprint-override""><code>someTest: client =&gt; {
  // regular Nightwatch testing omitted ...
  // and finally:
  client.execute(
    function () { return window },
    [],
    function (r) {
      console.log(r.value.mapInstance.getView().getZoom())
      client.end()
   }
  )
}
</code></pre>

<p>That throws me an error:
<code>Error while running .executeScript() protocol action: javascript error: circular reference</code></p>

<p>r.value is then set to the error object, and the whole thing fails.</p>

<p>What am I doing wrong?</p>
",https://stackoverflow.com/questions/58025983/how-can-i-access-the-window-object-in-nightwatch-while-the-test-is-running,"['javascript', 'openlayers', 'nightwatch']",231,False,2,0
UI Testing in iOS/Swift,"<p>I am pretty new to <em>iOS</em> UITesting. I'm currently writing UITest for my app using <code>XCTest</code>. I was able to test if a <code>UIElement</code> is visible or hidden when a particular button is tapped. But I wanted to test if a certain method is called when a button is tapped. How to do this? Does this come under UI testing?</p>

<p>I also wanted to test the <code>UIElement</code>s visible/hidden only when certain sent events are triggered instead of tap. Can we test sent events like <code>Touch Down</code> or <code>Touch Up Inside</code> of the button? Any help is appreciated. Thanks.</p>
",https://stackoverflow.com/questions/55846184/ui-testing-in-ios-swift,"['ios', 'swift', 'user-interface', 'xctest', 'xcode-ui-testing']",706,True,0,2
Correct way to do async calls to get test data from REST end points inside Protractor?,"<p>We are doing end to end UI testing using Protractor and using Jasmine as BDD framework. We need text of UI to be validated against the data from REST API, for which we are using Axios!!
Is this the right approach?
Sample code is mentioned below:</p>

<pre><code>import axios from ""axios"";

describe(""Some test for "", () =&gt; {

beforeEach(function(done) {
  axios
    .get(
     ""******************""
    )
    .then(response =&gt; {
      data_file = response.data;
      done();
    });
});

it(""some spec "", done =&gt; {
  expect($('#someId').getText()).toBe(data_file.someData);
  done();
});

});
</code></pre>

<p>Can we use Chakram instead of Axios inside Jasmine in Protractor for fetching data?</p>

<p>If the above approaches are wrong, then what is the correct way of testing UI against data from REST end points? (Chai + Mocha + Chakram + Protractor) or anything else?</p>
",https://stackoverflow.com/questions/54249463/correct-way-to-do-async-calls-to-get-test-data-from-rest-end-points-inside-protr,"['javascript', 'jasmine', 'protractor', 'mocha.js', 'chakram']",632,True,0,1
Testing Django Apps On Heroku With Cypress,"<p>I'm a hobby web developer looking to build my first product with the django web framework which I will host on Heroku.  Cypress looks like a great modern tool for UI testing which I certainly want to use.  In local development I am using it within django testing so that the django staticliveservertestcase runs first - which creates a separate development server process, and a test database, if one hasn't been created already.  Within this test I then call a bash script which executes a cypress UI test.  See the example below.</p>

<p><strong>Bash Script -</strong></p>

<pre><code>#!/bin/bash

echo $1 # the 1st command line argument
echo $2 # the 2nd command line argument

./node_modules/.bin/cypress run --env baseUrl=$1 --spec $2
</code></pre>

<p><strong>Django Test Code -</strong></p>

<pre><code>class ExampleTest(StaticLiveServerTestCase):

    def test_view_url(self):
        from subprocess import run
        exit_code = run([
            './cypress/run.sh',
            f'http://{self.server_thread.host}:{self.server_thread.port}',
            'cypress/integration/sample_spec.js'
        ])
        self.assertEqual(0, exit_code.returncode)
</code></pre>

<p>From my understanding this is the opposite to the standard cypress approach.  Normally cypress runs outside of the app independently and simply runs through all the tests which interact with the app.  Here the cypress tests are called by the django process.  Unless I am mistaken there are obvious advantages to this approach.  I can test the UI and whether objects where created in the database after the UI test has run.</p>

<p>Is it possible, and if this how, to do this within Heroku?  So Heroku would simply call the test script -</p>

<pre><code>python manage.py test
</code></pre>

<p>And I get UI testing and unit testing all done in one go.  It would also be nice to see the tests running in interactive mode.  Which may be a challenge because Heroku obviously runs everything in a linux container - I don't plan on using Docker incidentally because I think that limits a lot of the features Heroku offers.</p>
",https://stackoverflow.com/questions/59519944/testing-django-apps-on-heroku-with-cypress,"['django', 'testing', 'heroku', 'integration-testing', 'cypress']",488,False,4,0
xUnit and White test failure cleanup,"<p>I am beginning to look into using White UI testing with XUnit.</p>

<p>The basic structure for my tests is</p>

<ul>
<li>Open the application</li>
<li>Test Something</li>
<li>Close the application</li>
</ul>

<p>This works really well when test passes. However, when a test fails, the application is not closed. If multiple tests fail, this leads to lots of opened instances of my application.</p>

<p>To get around this, I use try and finally blocks but it is not very nice.</p>

<p>Is there an alternate option which achieves the same cleanup behaviour but looks a bit nicer? Like a ""RunOnAssertFail"" method?</p>

<pre><code>[Fact]
public void MainWindowCreated()
{
    bool testFailed = false;

    Application application = Application.Launch(@""C:\Program\Program.exe"");
    Window mainWindow = GetWindow(application, ""MainWidndow"", 500);

    try
    {
        testFailed = true;
        mainWindow.Should().NotBe(null, "". Main Widndow could not be found"");
        testFailed = false;
    }
    finally
    {
        if (testFailed)
        {
            application.Close();
        }
    }

    /*
     * Rest of test case
     */

    application.Close();
}

private static Window GetWindow(Application application,
    string windowName,
    int timeoutAfterMilliseconds)
{
    Window window = null;

    try
    {
        window = Retry.For(
            () =&gt; application.GetWindows().First(
                windowX =&gt; windowX.Title.Trim().Equals(windowName.Trim())),
            TimeSpan.FromMilliseconds(timeoutAfterMilliseconds));
    }
    catch (InvalidOperationException)
    {

    }

    return window;
}
</code></pre>

<hr>

<p>Requires <a href=""https://www.nuget.org/packages/xunit"" rel=""nofollow noreferrer"">xUnit</a>, <a href=""https://www.nuget.org/packages/TestStack.White/"" rel=""nofollow noreferrer"">White</a> and <a href=""https://www.nuget.org/packages/FluentAssertions/"" rel=""nofollow noreferrer"">Fluent Assertions</a> to run.</p>
",https://stackoverflow.com/questions/55667168/xunit-and-white-test-failure-cleanup,"['c#', 'xunit', 'white-framework', 'fluent-assertions']",1898,True,2,2
Android - Espresso How to test an view after clicked and moved to another Activity,"<p>I'm beginner of Espresso UI Testing. I have an issue, I have found solution but I'm not know how to do that correctly :((</p>

<p><strong>Problem:</strong>
I have 2 ImageView, when I click on once will change drawable of it and start an Activity. I want to check drawable after click does correct?</p>

<p><strong>My code</strong></p>

<pre><code>// In Main Activity
val imageView1 = findViewById(R.id.iv_button1)
imageView1.setOnClickListener {
    imageView1.setImageDrawable(resources.getDrawable(R.drawable.image1))
    startActivity(Intent(applicationContext, OtherAcitivy1::class.java))
}
val imageView2 = findViewById(R.id.iv_button2)
imageView2.setOnClickListener {
    imageView2.setImageDrawable(resources.getDrawable(R.drawable.image2))
    startActivity(Intent(applicationContext, OtherAcitivy2::class.java))
}

// In Android Test Class
...After run activiy
@Test
fun checkClickImageView1() {
    onView(withId(R.id.iv_button1)).perform(click())

    // In here, I want to check the imageview has displayed drawable correctly
    onView(withId(R.id.iv_button1)).check(withDrawableMatcher(R.drawable.image1))
}
</code></pre>

<p>But, It throw an exception is could not found view with <code>R.id.iv_button1</code>. </p>

<p>I think, because I start <code>OtherActivty2</code> on action click so it could not found view with that <code>id</code> from root view of <code>OtherActivty2</code></p>

<p>Have any solution can help me check drawable of ImageView in this case?</p>

<p>Thanks so much.</p>
",https://stackoverflow.com/questions/58297097/android-espresso-how-to-test-an-view-after-clicked-and-moved-to-another-activi,"['android', 'android-espresso', 'ui-testing']",1457,True,1,1
Can we implement EarlGrey on Cucumberish?,"<p>I am new on Xcode.<br>we already implement EarlGrey framework as our native automation ios testing framework.<br> Then we want to implement BDD test on our automation IOS.<br>
I can run Cucumberish on UI testing, and run EarlGrey on Unit Test.
But I'm getting a problem when combining EarlGey and Cucumber.<br>
It throws an error like this</p>

<p><img src=""https://i.stack.imgur.com/QehnR.png"" alt=""""></p>

<p>as we know Cucumberish is based on Objective-C,<br> I think that error happens when EarlGrey framework converting to Objective-c but I am not sure because I am still new on swift and Objective-c.</p>

<p>i put my project on my github : <a href=""https://github.com/tnabror/CucumberishEarlGrey"" rel=""nofollow noreferrer"">https://github.com/tnabror/CucumberishEarlGrey</a></p>
",https://stackoverflow.com/questions/55139167/can-we-implement-earlgrey-on-cucumberish,"['ios', 'xcode', 'automation', 'bdd', 'earlgrey']",263,False,0,0
How to write an extension for graphic screens for codedui,"<p>I want to use codedui for winform application where some windows has graphic but I can not reach beyond graphic page by default. Codede ui recognize Control type as Client for the graphic windows.</p>

<p>So I want to write an extension for it , below pages describes an extension, it implements a class that derives from Control.ControlAccessibleObject, and override the AccessibilityObject property to return an object of your class. I want to ask what should I do next ? Has someone experience on this before ?</p>

<p><a href=""https://learn.microsoft.com/en-us/visualstudio/test/enable-coded-ui-testing-of-your-controls?view=vs-2017"" rel=""nofollow noreferrer"">https://learn.microsoft.com/en-us/visualstudio/test/enable-coded-ui-testing-of-your-controls?view=vs-2017</a></p>

<pre><code> public partial class ChartControl : UserControl
{
 // Overridden to return the custom AccessibleObject for the control.
 protected override AccessibleObject CreateAccessibilityInstance()
 {
    return new ChartControlAccessibleObject(this);
}

// Inner class ChartControlAccessibleObject represents accessible information
// associated with the ChartControl and is used when recording tests.
public class ChartControlAccessibleObject : ControlAccessibleObject
{
    ChartControl myControl;
    public ChartControlAccessibleObject(ChartControl ctrl)
        : base(ctrl)
    {
        myControl = ctrl;
    }
}
</code></pre>

<p>}</p>
",https://stackoverflow.com/questions/54005068/how-to-write-an-extension-for-graphic-screens-for-codedui,['coded-ui-tests'],20,False,0,0
How to verify presence of a modal dialog,"<p>I have a webpage that has a button to download a file. Once clicking the button there appears a modal dialog popup which has no buttons for 'Ok' or 'Cancel' it is just informative dialog that says 'Generating the debuginfo file. Please wait.'. In my ui testing I need to check for the presence of that dialog. The html code for this modal dialog is as provided below. How should I check the presence of the dialog?</p>

<p>I have tried using Alert class and using <code>Alert(driver).switch_to.alert()</code> and <code>Alert(driver).dismiss()</code> and <code>accept()</code>
I have also tried </p>

<pre><code>WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.ID, ""id_value"")))
</code></pre>

<p>EDIT: edited to add actual code.</p>

<p>The html code for this element has following parameters:</p>

<pre><code>     &lt;div class=""ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable"" style=""position: fixed; height: auto; width: 400px; top: 143px; left: 555.5px; display: block;"" tabindex=""-1"" role=""dialog"" aria-describedby=""dialog"" aria-labelledby=""ui-id-1""&gt;
      &lt;div class=""ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix""&gt;
      &lt;span id=""ui-id-1"" class=""ui-dialog-title""&gt;Download debug info&lt;/span&gt;
      &lt;button class=""ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close"" role=""button"" aria-disabled=""false"" title=""close""&gt;
        &lt;span class=""ui-button-icon-primary ui-icon ui-icon-closethick""&gt;
        &lt;/span&gt;
        &lt;span class=""ui-button-text""&gt;close&lt;/span&gt;
      &lt;/button&gt;
    &lt;/div&gt;
    &lt;div id=""dialog"" class=""ui-dialog-content ui-widget-content"" style=""width: auto; min-height: 0px; max-height: none; height: 177px;""&gt;
      &lt;br&gt;Generating the debuginfo file. Please wait.&lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-n"" style=""z-index: 90;""&gt;
      &lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-e"" style=""z-index: 90;""&gt;
      &lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-s"" style=""z-index: 90;""&gt;
      &lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-w"" style=""z-index: 90;""&gt;
      &lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"" style=""z-index: 90;""&gt;
      &lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-sw"" style=""z-index: 90;""&gt;
      &lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-ne"" style=""z-index: 90;""&gt;
      &lt;/div&gt;
      &lt;div class=""ui-resizable-handle ui-resizable-nw"" style=""z-index: 90;""&gt;

  &lt;/div&gt;
</code></pre>
",https://stackoverflow.com/questions/56396550/how-to-verify-presence-of-a-modal-dialog,"['python', 'selenium', 'xpath', 'css-selectors', 'webdriverwait']",2411,True,2,1
WebDriverException &#39;unknown error: no element reference returned by script&#39; when using element.click(),"<p>Trying automate UI testing using selenium '3.14.0' java '1.8.0_151'
Automation is running on standalone GUI and as plugin on another system in inner iframe
I have a label referring to hidden check box, partial elements you can see below..</p>

<pre><code>input[type=checkbox] {
display: none;

label {
cursor: pointer;
display: inline-block;
width: 100%;
padding: 0 0 0 1.333333rem;
</code></pre>

<p>When clicking on the label from the standalone UI - it works fine, but when clicking on the same one when it's in the iframe of the containing system, I get:</p>

<pre><code> org.openqa.selenium.WebDriverException: unknown error: no element reference returned by script
  (Session info: chrome=78.0.3904.97)
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 78.0.3904.97, chrome: {chromedriverVersion: 78.0.3904.11 javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 80eb99bb78d864bcd2a4c1d4205a5d1c
</code></pre>

<p>code:</p>

<pre><code>    WebDriver driver = new ChromeDriver(chromeOptions); 
    WebDriverWait wait = new WebDriverWait(driver, WEBDRIVER_WAIT_TIME_SEC);
WebElement plugin = getRemoteIframe(By.cssSelector(pluginIframeCss));
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(plugin));
WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(""my-id"")));
element.click();//throws WebDriverException
    WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id(""my-id"")));
element.click();//throws WebDriverException
</code></pre>

<p>be aware that I found the element with all attributes, element is visible and clickable and when trying to click on it from console(F12) it works, only click by code throws exception...</p>

<p>Is someone familiar with this issue?</p>
",https://stackoverflow.com/questions/58872973/webdriverexception-unknown-error-no-element-reference-returned-by-script-when,"['java', 'selenium', 'selenium-webdriver', 'selenium-chromedriver']",842,True,1,3
Rest Assured and selenium integration,"<p>I have a rest assured automation framework written and it is working well as of now. Now We have a to integrate api and UI testing.</p>

<p>Steps would be:</p>

<ol>
<li>Using Rest assured hit a Login API and get all required tokens</li>
<li>Using Selenium - launch browser and hit the URL- SOMEHOW (???) pass the tokens generated in step 1 to browser (i.e to driver) so that logged in session opens up for that URL-</li>
</ol>

<p>So basically automation need not login again in step 2 and just use token generated in step 1. driver will directly start actions on logged in page.</p>

<p>Is this even possible? if Yes, it will be great help to know some pointers..</p>
",https://stackoverflow.com/questions/54024408/rest-assured-and-selenium-integration,"['selenium', 'rest-assured']",1359,False,0,1
How to run UI tests with different configuration in Maven,"<p>I am new to automation UI testing and I am working on UI automation using Cucumber and Selenium. </p>

<p>So in my project, I created a Hook class to set up the web driver for testing. Something like this:</p>

<pre><code>System.setProperty(""webdriver.chrome.driver"", ""driver path"");
driver = new chrome driver;
</code></pre>

<p>But if I want to run the same test with different browsers and different environments. For example, I want to run tests with chrome and environment  A and run the same test with firefox and environment B. I plan to create two properties files for different environments</p>

<pre><code>env=qa
baseURl = http://qa......
username = test
password = test
</code></pre>

<p>and </p>

<pre><code>env=dev
baseURl = http://dev......
username = test1
password = test1
</code></pre>

<p>And I want to just put a maven command like </p>

<pre><code>mvn clean test broswer=chrome env=qa
</code></pre>

<p>to pick the properties from correct files and set the web driver according to the browser parameter.</p>

<p>Is it possible to do that? Any example for this kind of scenarios?  </p>
",https://stackoverflow.com/questions/57351389/how-to-run-ui-tests-with-different-configuration-in-maven,"['java', 'selenium', 'cucumber', 'ui-automation']",2157,True,2,2
NSOpenPanel Breaks UI Testing on macOS,"<p>I'm using Xcode to do UI testing on a sandboxed macOS app that has the <code>com.apple.security.files.user-selected.read-write</code> entitlement (i.e., can access files and folders explicitly selected by the user via an <code>NSOpenPanel</code> GUI).</p>

<p>I have noticed that code coverage stops right after the open panel is presented modally. This is my code:</p>

<pre><code>@IBAction func go(_ sender: Any) {

    let panel = NSOpenPanel()
    panel.canCreateDirectories = true
    panel.canChooseDirectories = true
    panel.canChooseFiles = false
    panel.allowsMultipleSelection = false

    let response = panel.runModal()

    switch response {
    case NSApplication.ModalResponse.OK:
        openPanelDidSelectURL(panel.urls[0])

    default:
        return
    }
}
</code></pre>

<p><em>(I have recorded my UI tests so that the <code>NSOpenPanel</code> is accepted right away, choosing the folder where it was open.)</em></p>

<p>Code coverage ends up highlighted like this:</p>

<p><a href=""https://i.stack.imgur.com/s3rVi.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/s3rVi.png"" alt=""enter image description here""></a></p>

<p>I have tried replacing the <code>switch</code> statement with a <code>fatalError()</code> call, but the UI test still completes successfully, suggesting that anything immediately after:</p>

<pre><code>let response = panel.runModal()
</code></pre>

<p>...is <em>not</em> executed during the test.</p>

<p>Disabling sandboxing seems to have no effect, so I suspect it is running the open panel modally that causes trouble... </p>
",https://stackoverflow.com/questions/55257246/nsopenpanel-breaks-ui-testing-on-macos,"['macos', 'xcode-ui-testing', 'nsopenpanel']",294,True,2,1
Espresso fragment transaction testing,"<p>I am working on the project. I start learning instrumental tests using <code>Espresso</code> to write UI testing. I have a bottom view each bottom view tab has a parent fragment &amp; their child fragments. I have done one wrong fragment transaction i.e when navigating toward home bottom view tab from services bottom view tab home is selected but showing services fragment.</p>

<p>I want to test when clicking on the home bottom view tab the home fragment is added or not. I have tried the code like this but it is passing on the wrong case as well</p>

<p>I have also go through the below StackOverflow posts but not working</p>

<p><a href=""https://stackoverflow.com/questions/27369760/determine-fragment-change-while-espresso-testing"">Determine fragment change while espresso testing</a></p>

<p><a href=""https://stackoverflow.com/questions/54491130/how-to-test-if-a-fragment-is-visible-with-espresso"">How to test if a fragment is visible with Espresso</a></p>

<pre><code>@Test
fun testHomeFragment_isDisplayed() {

    //click on home navigation button of bottom view
    onView(withId(R.id.navigation_home)).perform(click())

    //click on services navigation button of bottom view
    onView(withId(R.id.navigation_more)).perform(click())

    //click on recycler view item at given position
    onView(withId(R.id.more_rv)).perform(
            RecyclerViewActions.actionOnItemAtPosition&lt;RecyclerView.ViewHolder&gt;(
                    1,
                    MyViewAction.clickChildViewWithId(R.id.row_more_parent)));

    //Again click on home navigation button of bottom view
    onView(withId(R.id.navigation_home)).perform(click())

    //check that the home fragment is displayed or not.
    onView(allOf(withId(R.id.home_pager), withParent(withId(R.id.papa)))).
            check(matches(isCompletelyDisplayed()))

}
</code></pre>

<p><strong>How to know which fragment is currently displayed on the screen?</strong></p>
",https://stackoverflow.com/questions/54806639/espresso-fragment-transaction-testing,"['android', 'android-fragments', 'kotlin', 'android-espresso', 'ui-testing']",944,False,6,0
How to get the index of a cell given the text inside in XCUITest?,"<p>I'm testing a tableview the cell content in XCUItest. In my case, I don't know the order of the cell text, nor am I allowed to set an accessibility id for the text.  How can I get the index of a cell given the text inside? </p>

<p><a href=""https://i.stack.imgur.com/J6a9R.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/J6a9R.png"" alt=""enter image description here""></a></p>

<p>For instance, if I wanted to get the index of the cell containing text ""Cell 2 Text"" I would try something like this:</p>

<pre><code>func testSample() {
    let app = XCUIApplication()
    let table = app.tables
    let cells = table.cells

    let indexOfCell2Text = cells.containing(.staticText, identifier: ""Cell 2 Text"").element.index(ofAccessibilityElement: ""I dunno"")
    print(indexOfCell2Text)
}
</code></pre>

<p>I feel like I'm close, but I'm unsure. Can anyone suggest a solution?</p>

<p>I apologize if this question has been asked before. I wasn't able to find anything specific about this.</p>

<p>References I visited beforehand:
<a href=""https://developer.apple.com/documentation/xctest/xcuielementquery/1500842-element"" rel=""nofollow noreferrer"">https://developer.apple.com/documentation/xctest/xcuielementquery/1500842-element</a></p>

<p><a href=""https://stackoverflow.com/questions/32365327/how-can-i-verify-existence-of-text-inside-a-table-view-row-given-its-index-in-an/32389031"">How can I verify existence of text inside a table view row given its index in an XCTest UI Test?</a></p>

<p><a href=""https://stackoverflow.com/questions/36566558/ios-ui-testing-tap-on-first-index-of-the-table"">iOS UI Testing tap on first index of the table</a></p>
",https://stackoverflow.com/questions/56637126/how-to-get-the-index-of-a-cell-given-the-text-inside-in-xcuitest,"['swift', 'xcode', 'xctest', 'xcuitest']",3398,True,2,2
Transition animation scale does not disable animation inside application,"<p>I encountered a problem while doing some Espresso UI testing: I want to disable the animations inside my application so that i don't need to set timeouts/need to wait for the animation to finish.</p>

<p>Disabling the Window animation scale, Transition animation scale, Animator duration scale inside the developers options on my android device does not disable the animations while navigating between fragments with the navigation component of android. </p>

<p>The animation is being set like following:</p>

<pre><code>&lt;action
    android:id=""@+id/confirmationAction""
    app:destination=""@id/confirmationFragment""
    app:enterAnim=""@anim/slide_in_right""
    app:exitAnim=""@anim/slide_out_left""
    app:popEnterAnim=""@anim/slide_in_left""
    app:popExitAnim=""@anim/slide_out_right"" /&gt;
</code></pre>

<p>How can I disable this animation while running my espresso UI tests?</p>

<p>UPDATE:</p>

<p>I followed <a href=""https://developer.android.com/guide/navigation/navigation-animate-transitions"" rel=""noreferrer"">this guide of google</a> about navigation between fragments with the navigation component.</p>

<p>Then I looked at the guide of google about testing my application with Espresso and on both <a href=""https://developer.android.com/training/testing/espresso/setup"" rel=""noreferrer"">the first guide</a> and <a href=""https://developer.android.com/training/testing/ui-testing/espresso-testing"" rel=""noreferrer"">the second guide</a> that i found is that the first point is to disable the animations via developers options, therefore I thought that this was the correct way of disabling the animations</p>
",https://stackoverflow.com/questions/59289976/transition-animation-scale-does-not-disable-animation-inside-application,"['android', 'animation', 'navigation', 'android-espresso']",1038,True,10,2
Errors in UI tests have no location in Xcode (&lt;unknown&gt;:0),"<p>I recently added a UI Testing target to our existing project (which already has an iOS app target and a couple of other testing targets). Everything is working as expected and UI tests run without problems, but if a test fails the errors are never displayed in the file they occur and the Test Report shows them at <code>&lt;unknown&gt;:0</code> while the Issue Navigator shows them at <code>&lt;unknown&gt;</code>:</p>

<p><a href=""https://i.stack.imgur.com/cKqSO.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/cKqSO.png"" alt=""Error as shown in Xcode""></a></p>

<p>It does mark the correct test as failed, but doesn't shown an error inside the editor. I looked through the build settings but couldn't find anything out of the ordinary. </p>

<p>Naturally, this makes debugging the tests much more annoying and harder. The usual clean/derived data/xcode restart magic hasn't done anything.</p>

<p><strong>Update</strong>: After investigating further, it turns out that this is NOT a problem for assertion failures, which show up correctly.</p>
",https://stackoverflow.com/questions/55121665/errors-in-ui-tests-have-no-location-in-xcode-unknown0,"['ios', 'swift', 'xcode', 'xctest', 'xcuitest']",196,False,1,0
How to test fragment properly in Android,"<p>I have been following the single activity model and MVVM in app development; So I have a single activity and the rest of UIs are all fragments. So, each single fragment is self-contained and I would like to test each single fragment without leaking state.</p>

<pre><code>@RunWith(AndroidJUnit4::class)
class SplashFragmentTest {

    @Test
    fun testVisibilityOfLogo() {
        launchFragmentInContainer&lt;SplashFragment&gt;()
        onView(ViewMatchers.withId(R.id.ivLogo))
                .check(matches(isDisplayed()))
    }
}
</code></pre>

<p>I have following test, which is throwing </p>

<pre><code>Activity never becomes requested state ""[RESUMED, STARTED, DESTROYED, CREATED]"" (last lifecycle transition = ""PRE_ON_CREATE"")
</code></pre>

<p>I have followed the android docs as well:  <a href=""https://developer.android.com/training/basics/fragments/testing"" rel=""nofollow noreferrer"">https://developer.android.com/training/basics/fragments/testing</a></p>

<p>According to the docs, </p>

<blockquote>
  <p>After launching one of these fragment types, FragmentScenario drives
  the fragment under test to the RESUMED state. This state indicates
  that the fragment is running. If you're testing a graphical fragment,
  it's also visible to users, so you can evaluate information about its
  UI elements using Espresso UI tests.</p>
</blockquote>

<p>It seems like it is not happening. Does anyone come across such a problem with UI testing with fragment?</p>
",https://stackoverflow.com/questions/59381278/how-to-test-fragment-properly-in-android,"['android', 'unit-testing', 'android-fragments', 'android-testing', 'ui-testing']",1182,True,1,1
Protractor: Dashboard filters not being selected,"<p>I'm using Protractor to do some automated UI testing for my Qlik dashboards. Currently using <a href=""https://sense-demo.qlik.com/sso/sense/app/dcb7c95a-9ecd-43e2-8786-cae00108a324/sheet/54b60312-68c5-4d92-a225-79326b68ad5a/state/analysis"" rel=""nofollow noreferrer"">this sample dashboard</a> to run some tests. I plan to just try different combinations of filters to see if any dashboard graphs fail to render.</p>

<p>For the case of the sample dashboard, I intend to just click on each of the 4 filters at the top of the page and select the first option.</p>

<p>For some reason I just can't get protractor to select the filters for me. I always get a timeout error.</p>

<p>I've tried using browser.driver instead of the default browser. I realized that I have to use browser.driver.get('url') or the page won't load. I have no idea why this is so.</p>

<p>Shown below is my current code:</p>

<pre><code>describe('Qlik Dashboard Test', function() {
    it('Primary Filter Testing',function(){
        var url = 'https://sense-demo.qlik.com/sso/sense/app/dcb7c95a-9ecd-43e2-8786-cae00108a324/sheet/54b60312-68c5-4d92-a225-79326b68ad5a/state/analysis';
        var EC = protractor.ExpectedConditions;
        // Reference to all filters
        var filter = element.all(by.className('title ng-binding'));
        // Reference to first option in each filter
        var first_opt = element(by.repeater('textItem in item.textItems'));
        // Reference to backbutton
        var bb = element.all(by.className('lui-clear-all lui-icon lui-icon--remove'));
        // Go to website
        browser.driver.get(url);
        // Wait for all filters to be visible
        browser.wait(EC.visibilityOf(filter , 10000));

        // Click on each filter, and select the first avaiable option
        filter.each(function(main_filter){
            browser.actions().mouseMove(main_filter).click().perform().then(function(){
                browser.driver.wait(EC.visibilityOf(first_opt,15000));
            }).then(function(){
                browser.actions().mouseMove(first_opt).click().perform();
            });

        });

        // Click on back button
        bb.each(function(backbutton){
            browser.actions().mouseMove(backbutton).click().perform();
        }).then(function(){
            browser.sleep(2000);
        });


    })
})
</code></pre>

<p>This is the error message that I keep receiving:</p>

<pre><code>    Failed: script timeout: result was not received in 11 seconds
      (Session info: chrome=71.0.3578.98)
      (Driver info: chromedriver=2.45.615355 (d5698f682d8b2742017df6c81e0bd8e6a3063189),platform=Mac OS X 10.14.0 x86_64)
</code></pre>

<p>Any help would be greatly appreciated!</p>
",https://stackoverflow.com/questions/54474908/protractor-dashboard-filters-not-being-selected,"['javascript', 'protractor', 'automated-tests']",147,True,1,3
Testing views constraints programmatically ( In Unit test ),"<p>I have built all my UI programmatically without using IB in Xcode. Now I want to assert that the constraints are correct in my Unit Tests ( Yes, not in UI testing ).</p>

<p>I have some constraints like these :</p>

<pre><code>footer.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
footer.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
footer.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
footer.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.08).isActive = true
</code></pre>

<p>Now I want to test this in my unit testing. I can assert that the footer is not nil, and that it has the expected properties except for the dimensions, as they show up as 0 always. For instance, this is something I tried but it did not work :</p>

<pre><code>XCTAssertTrue(subject.getFooterView().frame.origin.y == subject.view.frame.origin.y)
</code></pre>

<p>Which I think should be true but it fails. If I print the values of each property, I can see that the value <strong>subject.view.frame.origin.y</strong> is <em>414</em> but the value <strong>subject.getFooterView().frame.origin.y</strong> is always <em>zero</em>.</p>

<p>Same happens with all the other properties, for instance <strong>frame.size.width</strong>, etc, are always <em>zero</em> for my footer.</p>

<p>Can someone help me to understand this?</p>
",https://stackoverflow.com/questions/57394388/testing-views-constraints-programmatically-in-unit-test,"['swift', 'unit-testing']",1742,True,1,1
Are using div tags faster than using table tr and td tags for tabular data of huge size?,"<p>I have a huge table loading from remote aws ec2 server through php scripts accessing a postgres database.
Currently, there are 2000 rows with 20 columns in the table, taking about 2 min to load after all query optimizations and using multidimensional php arrays to store data for all members through a single query instead of querying the database every now and then for each of the 2000 users.</p>

<p>I was able to reduce the loading time from 5 min to 2 min.</p>

<p>My question is, does the UI also needs to be optimized? Is the traditional table tag outdated? Which is the best way to go about?</p>

<p>Suppose i have all the data ready. If I need to put them out to display instantly, in huge numbers, which is the best way to do it? </p>

<p>I'm not very well versed with HTML or CSS or even UI testing. </p>
",https://stackoverflow.com/questions/58160389/are-using-div-tags-faster-than-using-table-tr-and-td-tags-for-tabular-data-of-hu,"['php', 'html', 'css', 'sql', 'html-table']",224,True,1,2
Easy Repro UI Automatid testing test fails. with error LoginPage&#39; threw an exception of type &#39;System.MissingMethodException&#39;,"<p>I trying to use EasyRepro <a href=""https://github.com/microsoft/EasyRepro/tree/releases/OnPremise"" rel=""nofollow noreferrer"">https://github.com/microsoft/EasyRepro/tree/releases/OnPremise</a> to automate UI testing for our on premise Customer Relationship Management site part of the Dynamic 365 apps.</p>

<p>What I have tried so far is running the sample test which comes with the EasyRepro as well as using an ADFS login function. I have also tried the later and earlier branches of the Easy Repro and the on premise branch, since I am using an on premise version of CRM. I ensured the drivers were installed and that I am using the correct versions as well that they are all compatible. </p>

<p>What happens is the google chrome browser opens up to the CRM website then meets the login page. Nothing happens till the test times out after about 3 minutes.</p>

<p>Specs</p>

<p>Visual Studio Enterprise 2017</p>

<p>Google Chrome v74</p>

<p>Windows Server 2012 R2</p>

<p>CRM Version 1612 (8.2.2.112) on-premises</p>
",https://stackoverflow.com/questions/56344515/easy-repro-ui-automatid-testing-test-fails-with-error-loginpage-threw-an-excep,"['visual-studio', 'visual-studio-2017', 'dynamics-crm', 'easyrepro']",471,False,1,0
"When trying to send a scroll event based off of a user&#39;s recorded actions, the distance scrolled is not the same as the user&#39;s","<p>I'm trying to create an application in Swift 5 that captures all mouse and keyboard events (essentially a keylogger) and saves them into a .csv so it can later playback the events by reading that .csv. It also records a video for reference. This is for the purpose of quality/UI testing and to help capture exact workflows from different types of users. I've got clicks and keystrokes working, but I'm having some issues with scrolling. I try capturing the event.scrollingDeltaY and then creating a CGEvent to send it, but the result is very jumpy and doesn't match the scrolling the user did.</p>

<p>I've tried scrollingDeltaY and for the CGEvent unit I've tried both CGScrollEventUnit.pixel and CGScrollEventUnit.line, but both aren't behaving as I expect. </p>

<pre class=""lang-swift prettyprint-override""><code>// Creating the string to add to the .csv during recording
tempStr += event.deltaX.description + "","" + event.scrollingDeltaY.description + ""\n""



// the CGEvent created during playback
let eventScroll = CGEvent(scrollWheelEvent2Source: nil, units: CGScrollEventUnit.pixel, wheelCount: 1, wheel1: Int32(deltaY), wheel2: 0, wheel3: 0)

eventScroll?.post(tap: .cghidEventTap)
</code></pre>

<p>I expect the app to scroll the same distance as the user did, however that is not the case here.</p>
",https://stackoverflow.com/questions/57480474/when-trying-to-send-a-scroll-event-based-off-of-a-users-recorded-actions-the-d,"['swift', 'macos', 'scroll']",180,False,0,1
Detox automation test times out randomly,"<p>I've started to use Detox to create automation UI testing for our react-native app (here testing on iOS).</p>

<p>I've noticed that Detox (or Jest) times out randomly. The exact same test sometimes passes, but some other time it get stuck and doesn't continue running the test. Once the jest timeout is over I get the following error</p>

<pre><code>Timeout - Async callback was not invoked within the 40000ms timeout specified by jest.setTimeout.

  47 |     });
  48 |     describe('when the user taps on the payment history tab', () =&gt; {
&gt; 49 |       it('should go on the payment history view', async () =&gt; {


  at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:92:20)
  at Suite.&lt;anonymous&gt; (e2e/tests/loans/index.test.js:49:7)
</code></pre>

<p>One of my test looks like this:</p>

<pre><code>  it('should go on the payment history view', async () =&gt; {
    await element(by.id('product-tab-2')).tap();
    await waitFor(element(by.id('product-payment-history-1')))
      .toBeVisible()
      .withTimeout(5000);
    await expect(element(by.id('product-payment-history-1'))).toBeVisible();
  });
</code></pre>

<p>I've attempted to use the ""trace"" flag to see if there were any details about why it gets stuck. It seems like some <code>invoke</code> calls are skipped and it tries to execute the following test before it actually finished the previous one.</p>

<p>I don't think it's an issue with the tests themselves as they happen to all run 3 out of 4 times I'd say.</p>

<p>Does anyone have this issue? Is there a way to fix it? Or is there a way to restart the test set if something freezes?</p>

<p>Thanks!</p>
",https://stackoverflow.com/questions/54693619/detox-automation-test-times-out-randomly,"['react-native', 'detox']",1510,True,1,1
"Session not created, This version of ChromeDriver only supports Chrome version 74","<p>In my machine the version of the Chrome Browser is Version 78.0.3904.108. </p>

<p>And following is the code I used to run the selenium script in the chrome browser. </p>

<pre><code>System.setProperty(""webdriver.chrome.driver"", ""C:\\Users\\ChampWk21\\Downloads\\chromedriver_win32\\chromedriver.exe"");
WebDriver driver = new ChromeDriver();
</code></pre>

<p>Following is the Exception I got when I try to run the code: </p>

<pre><code>Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 27833
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Exception in thread ""main"" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.66 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'DESKTOP-BHL4HJ3', ip: '192.168.1.16', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211'
Driver info: driver.version: ChromeDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
    at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
    at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
    at org.openqa.selenium.remote.RemoteWebDriver.&lt;init&gt;(RemoteWebDriver.java:131)
    at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:181)
    at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:168)
    at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:123)
    at WDSel.main(WDSel.java:12)
</code></pre>

<p>I have developed a framework for UI Testing. And this error occurred because of chrome driver version is not compatible with the Chrome Browser. So I have to use the chrome driver version which is suiting for the current version of the Chrome Browser.</p>

<p><strong>My Question is when the version of the Chrome Browser is changing time to time do we have to download the chrome driver which is suiting for the exact version of the Chrome browser. Aren't there other ways to handle it. Specially when comes to a framework use, can't we implement a way to automatically update the drivers instead of manually download the drivers and set the path.</strong></p>

<p>Thanks.</p>
",https://stackoverflow.com/questions/59368790/session-not-created-this-version-of-chromedriver-only-supports-chrome-version-7,"['java', 'selenium', 'selenium-webdriver', 'selenium-chromedriver', 'ui-automation']",3771,True,1,1
Unable to open any URLs with Selenium using Chrome driver in Testcontainers,"<p>I'm trying to set up a UI testing framework on a project using Selenium in JUnit tests inside of Testcontainers, using IntelliJ IDE to develop. I am using OpenJDK 12.0.1</p>

<p>I have the most basic test that I can think of, but I keep getting Null Pointer Exceptions when trying to get ANY website (wikipedia, google, etc.)</p>

<p>Am I missing something crucial here?</p>

<p>Here is the test that I have set up:</p>

<pre><code>public class SimpleTest {

 @Rule
 public BrowserWebDriverContainer chrome = new BrowserWebDriverContainer()
  .withCapabilities(new ChromeOptions());

 @Test
 public void simplePlainSeleniumTest() {
  RemoteWebDriver driver = chrome.getWebDriver();

  driver.get(""https://google.com"");

  assertTrue(""This should always pass"", true);
 }

}
</code></pre>

<p>In my gradle file I am importing the following:</p>

<pre><code>compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
compile group: 'org.seleniumhq.selenium', name: 'selenium-remote-driver', version: '3.141.59'
testCompile group: 'org.testcontainers', name: 'selenium', version: '1.11.3'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.2.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.2.0'
test {
    useJUnitPlatform()
}
</code></pre>

<p>I have no special settings in my testcontainers.properties file</p>

<p>If I am understanding all of the examples I have seen, this should be:</p>

<ol>
<li>Opening the test inside a docker container via testcontainers.</li>
<li>Creating a driver for Chrome inside of that container.</li>
<li>Navigating to the given website (in the example above, google.com)</li>
<li>Passing, because true = true</li>
</ol>

<p>But I run into the following error no matter what I am changing code-wise:</p>

<pre><code>selenium.SimpleTest &gt; simplePlainSeleniumTest() FAILED
    java.lang.NullPointerException at SimpleTest.java:34
</code></pre>

<p>Line 34 is: <code>driver.get(""https://google.com"");</code></p>
",https://stackoverflow.com/questions/56591202/unable-to-open-any-urls-with-selenium-using-chrome-driver-in-testcontainers,"['java', 'selenium', 'junit', 'testcontainers']",490,True,0,1
Creating Windows 10 VM with Azure Powershell cmdlet New-AzVM,"<p>I need to create a Windows 10 VM in Azure through a script that can be called in a CI pipeline in order to create a nested android emulator for automated UI testing. The script creates the VM using the new Azure powershell modules (in this case Az.Compute), but it seems that the cmdlet New-AzVm only accepts a limited list of image names in its -ImageName parameter. Is there a way to specify to this cmdlet that I want to create a Windows 10 VM?</p>

<p>I have tried using the format Publisher:Offer:Sku:Version for a Windows 10 Pro image, but it was unable to recognize this format.</p>

<pre><code>$ImageName = ""MicrosoftWindowsDesktop:Windows10:rs5-pro:latest""

# Create the VM
New-AzVM `
  -ResourceGroupName $ResourceGroup `
  -Name $VmName `
  -Location $Location `
  -ImageName $ImageName `
  -Size $VmSize `
  -VirtualNetworkName $VnetName `
  -SubnetName $SubnetName `
  -SecurityGroupName $NsgName `
  -PublicIpAddressName $PipName `
  -Credential $Cred `
  -OpenPorts 3389 `
  -Verbose
</code></pre>

<p>I expected to have a windows 10 vm created in my azure resource group, but instead received the following error:</p>

<p>New-AzVM : Artifact: VMImage was not found.
At line:1 char:1
+ New-AzVM -ResourceGroup androidexample -Location eastus -ImageName ""M ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : CloseError: (:) [New-AzVM], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand</p>
",https://stackoverflow.com/questions/58068397/creating-windows-10-vm-with-azure-powershell-cmdlet-new-azvm,"['azure', 'powershell', 'android-emulator', 'windows-10', 'azure-powershell']",1824,True,0,1
How do I find if a variable has been defined?,"<p>How do I find out if a variable has been defined in my Robot Framework script?  I am doing API testing, not UI testing.  I have a complex set up and tear-down sequence and, since I am interacting with multiple computers through the script, it is important to know the current state if a fatal error has occurred.  I could track what I have done with some complex set of meta variables or a variable tracking list, but I would prefer to query if a particular variable has been defined and if so take the appropriate tear-down steps.</p>

<p>A simplified version is something like:</p>

<pre><code>*** Test Cases ***
Check monitor
    ${monitored}=  Connect to Monitor  ${Monitor IP Address}  ${User name}  ${password}
    ${peer connected}=  Connect to Monitor  ${Peer IP Address}  ${User name}  ${password}
    Get Information from Monitor  ${IP Address}
    Send Info to Peer   ${buffer1}
    Report back to Monitor  ${Monitor IP Address}
</code></pre>

<p>We are assuming that the tear-down closes the connections.  I want to close any connections that are open, but if I failed to open the peer connection I will close the monitor connection and fail on closing the monitor connection.</p>

<p>I am trying to determine if ${peer connected} is defined.  Can I look into Robot Framework's variable storage to see if it is there (in that dictionary?)?</p>
",https://stackoverflow.com/questions/58884481/how-do-i-find-if-a-variable-has-been-defined,"['robotframework', 'metaprogramming']",10344,True,7,5
What&#39;s the difference between a UI test and an E2E Test? And What&#39;s the benefits of each?,"<p>Our team is considering starting testing based on user scenarios. So, we are picking a E2E framework.</p>

<p>Searching for <code>UI test</code> lead to the following:</p>

<p>So, I found this <a href=""https://stackoverflow.com/questions/40564794/what-is-the-difference-between-ui-gui-testing-functional-testing-and-e2e-testin"">this</a> </p>

<p>It says</p>

<p><strong>UI testing</strong>: user interface testing. In other words, you have to make sure that all buttons, fields, labels and other elements on the screen work as assumed in a specification.</p>

<p><strong>GUI testing</strong>: graphical user interface. You have to make sure that all elements on the screen work as mentioned in a specification and also color, font, element size and other similar stuff match design.</p>

<p><strong>Functional testing</strong>: the process of quality assurance of a product that assumes the testing of the functions/functionalities of component or system in general, according to specification requirements.</p>

<p><strong>E2E testing</strong>: it needs for identifying system dependencies and ensuring that the right information is passed through multiple components and systems.</p>

<p>I don't get the difference between <code>UI Testing</code> &amp; <code>E2E Testing</code>. </p>

<p>I wrote UI Test Code in Android Studio. And I need to write a code for each and every click and view, etc. I feel why do we need this? I'd rather test with my finger directly and dynamically. </p>
",https://stackoverflow.com/questions/57198214/whats-the-difference-between-a-ui-test-and-an-e2e-test-and-whats-the-benefits,"['android', 'unit-testing', 'e2e-testing', 'ui-testing', 'gui-testing']",8392,True,10,1
WebdriverIO function reusability pattern,"<p>I am transitioning from Selenium to WebdriverIO and I'm running into some difficulty regarding function reusability. Let me demonstrate with an example:</p>

<pre><code>&lt;nav&gt;
  &lt;div&gt;&lt;a&gt;Clients&lt;/a&gt;&lt;/div&gt;
  &lt;div&gt;&lt;a&gt;Accounts&lt;/a&gt;&lt;/div&gt;
  &lt;div&gt;&lt;a&gt;Packages&lt;/a&gt;&lt;/div&gt;
&lt;/nav&gt;
</code></pre>

<p>lets say I have a navigation bar with 3 links above. When I land on this page, I want to check if each link exists. My function may look something like this:</p>

<pre><code>class LoginPage extends Page {

  get clientsLink() { return $('//a[contains(., ""Clients"")]'); }


  isTabDisplayed() {
    if (this.clientsLink.isDisplayed()) {
      return true;
    } else {
      false
    }
  }
}
</code></pre>

<p>this is fine except I would have to write 2 more getters for <code>Accounts</code> and <code>Packages</code> and so my class would look like this:</p>

<pre><code>class LoginPage extends Page {

  get clientsLink() { return $('//a[contains(., ""Clients"")]'); }
  get accountsLink() { return $('//a[contains(., ""Accounts"")]'); }
  get packagesLink() { return $('//a[contains(., ""Packages"")]'); }

  isClientTabDisplayed(tab) {
    if (this.clientsLink.isDisplayed()) {
      return true;
    } else {
      false
    }
  }

  isAccountsTabDisplayed(tab) {
    if (this.accountsLink.isDisplayed()) {
      return true;
    } else {
      false
    }
  }

  isPackagesTabDisplayed(tab) {
    if (this.packagesLink.isDisplayed()) {
      return true;
    } else {
      false
    }
  }
}
</code></pre>

<p>at this point, my anxiety kicks in and I start to think of ways I can reuse the <code>isTabDisplayed</code> function where I can pass a string to the getter with my tab name, or something along the lines of that. </p>

<p>Unfortunately, getters do not accept parameters and so far I have not found any resources on google that can help me to solve this issue (most common being Page Object Model which doesn't seem to address this problem)</p>

<p>Is my thought process out of line that I am striving for reusable code in UI testing or am I not googling for correct patterns?</p>
",https://stackoverflow.com/questions/55029803/webdriverio-function-reusability-pattern,"['webdriver-io', 'reusability', 'ui-testing']",463,True,1,1
swift / CoreData - Create &quot;dummy&quot; NSManagedObjecIDs for data models (to test things without the need of managed objects),"<p>Say I have 2 <code>NSManagedObject</code>s in <code>CoreData</code>.</p>

<pre class=""lang-swift prettyprint-override""><code>class House: NSManagedObject {}
class Location: NSManagedObject {}
</code></pre>

<p>I also have data model <code>structs</code> like this:</p>

<pre class=""lang-swift prettyprint-override""><code>struct HouseModel {
    var objectID: NSManagedObjectID
    ...
}

sruct LocationModel {
    var objectID: NSManagedObjectID
    ...
}
</code></pre>

<p>For each loaded <code>managedObject</code> I basically use its attributes to initialize a new model struct to use for the UI and stuff (mainly collection views)</p>

<p>I have to have the <code>NSManagedObjectID</code> attribute in the <code>structs</code> in order to be able to make changes to the <code>managedObject</code> that struct belongs to. (I learned that I should use the <code>mainViewContext</code> only for reading while using something like <code>persistentContainer.performBackgroundTask</code> for writing. Thus, I need the <code>NSManagedObjectID</code> to load the objects on a background queue)</p>

<p>That's working but there is a problem with this approach:
I can't initialize one of these data models without a <code>managed object</code>. That's annoying when I want to create dummy data for UI testing or unit testing.</p>

<p>I know one solution: Create a <code>Dummy</code> <code>managedObject</code> with exactly one instance and use its objectID for stuff like that. But I don't really like this. Is there a better / more convenient way?</p>

<p>I mean, I would love to entirely remove the <code>objectID</code> attribute to keep <code>CoreData</code> separate from these model <code>structs</code>. But I don't see a way to do this. I need the connection.</p>
",https://stackoverflow.com/questions/56516220/swift-coredata-create-dummy-nsmanagedobjecids-for-data-models-to-test-thi,"['ios', 'swift', 'core-data']",605,True,0,1
Stubbing HTTP requests with Mockingjay not working,"<p>I am trying to understand how to write UI tests, but I can't seem to get HTTP stubbing to work. When I run the test, I don't see the data from the stub, but the data from the API.</p>
<p>I have tried it in Xcode 10.2 and 9.4.1, so it's not because it no longer works in Xcode 10.</p>
<p>I must be doing something wrong somewhere, but I can't figure out what.</p>
<p>I have created a minimal example to check if it was because I was working in a big project and something was interfering, but that didn't work.</p>
<p>In my viewcontroller I have a simple tableview setup that does an API call, and loads the result into rows. I have a UI testing target that has a simple test setup which uses Mockingjay to stub the HTTP request.</p>
<p>My API call code:</p>
<pre><code>func callSimpleAPI(completionHandler: @escaping ([Patient]?, Error?) -&gt; ()) {
    let url = URL(string: &quot;https://pastebin.com/raw/3PusWbw6&quot;)!
    
    let task = URLSession.shared.dataTask(with: url) { data, response, error in
        DispatchQueue.main.async {
            guard let data = data else {
                completionHandler(nil, error!)
                return
            }
            
            do {
                let patientResponse = try JSONDecoder().decode(TherapistPatientResponse.self, from: data)
                completionHandler(patientResponse.patients, nil)
            } catch {
                completionHandler(nil, error)
            }
        }
    }
    task.resume()
}
</code></pre>
<p>And my testing code:</p>
<pre><code>override func setUp() {
    let app = XCUIApplication()
    app.launch()
    
    stub(everything, json(/*A json representation of the API response that I want to see*/))
}
</code></pre>
<p>Edit: I tried this on my iPhone running iOS 12.3 beta and the simulator (not beta).</p>
<p>Edit: Doesn't work with OHHTTPStubs either. Added a branch <code>OHHTTPStubs</code> to the example project.</p>
<p>Edit: I am on macOS Mojave 10.14.3, and I used Xcode 10.2 and 9.4.1 to test. I tried my iPhone running iOS 12.3 and the Simulator running iOS 12.2</p>
",https://stackoverflow.com/questions/55521206/stubbing-http-requests-with-mockingjay-not-working,"['swift', 'xcode-ui-testing', 'stub']",1040,True,5,1
Add Test Steps in JUNIT to get better reporting,"<p>I am running UI testing with Jest and I am using a custom reporter to generate a JUNIT.xml file at the end of the run <a href=""https://github.com/jest-community/jest-junit"" rel=""nofollow noreferrer"">https://github.com/jest-community/jest-junit</a> , so that my azure pipeline can read it and generate nice analytics. My test framework is organize around Test suite that represent a big functionality, then each aspect of that functionality is check within a test contain in the suite ( That check might require multiple steps ) and I would like show each of those steps. This way i think it would be more readable for anyone looking at the report and it would be very easy to get context on why a test failed.</p>

<ul>
<li>I try to put assertion at each steps. But JUNIT only record the assertion that failed.</li>
<li>I also try to change the way my test are organize and make a step a test itself. But, in Jest, and it seem in a lot of other runner as well ( at least in Node ) it seem that it's not possible to guarantee easily that test are run in a specific sequence. Also, it's really verbose to code suite like this.</li>
</ul>

<p>Does anybody have an idea on how I could achieve this granularity ? </p>

<p>Thank you.</p>
",https://stackoverflow.com/questions/57153276/add-test-steps-in-junit-to-get-better-reporting,['junit'],267,False,1,0
How to initialize emulated external dependencies in a Kotlin Android UI test,"<p>I'll be developing an Android app in Kotlin and I'm trying to figure out how to initialize emulated dependencies.  For example, the app will make API calls to a server, obtain the user's location from a location provider, pull down images from a content management system, store data locally in a database and in Android's Shared Preferences, and do math based on the current date/time.  Thus there are a lot of external dependencies I want to emulate, including the current date/time so I can verify age calculation, etc.</p>

<p>My goal for testing is just to validate my app's screens using an Android instrumented test.  I don't want any dependency on real external systems because testing those systems is the responsibility of the developers of those systems.</p>

<p>While reading Android'd documentation <a href=""https://developer.android.com/training/testing/fundamentals#test-doubles"" rel=""nofollow noreferrer"">Consider whether to use test doubles</a>, I noticed it offered a good tip: ""Tip: Check with the library authors to see if they provide any officially-supported testing infrastructures, such as fakes, that you can reliably depend on.""  However, the documentation doesn't really explain how to initialize a 3rd party test infrastructure.</p>

<p>Below are what I understand so far about my options, but they all come back to a fundamental thing I don't understand: how does an Android app under test know it should operate in a test mode vs. a production mode?</p>

<ol>
<li><p><strong>Mocking such as Mockito or MockK:</strong>  Mocking seems like a special case of Dependency Injection tailored for testing.  The examples I've seen involve testing a class or a method, not a full scale system.  The examples typically show how you mock a class and pass it to the class/method under test.  But with a full scale system, the test code operates on widgets referenced via Espresso.  There is no access to the classes where the logic is.  My impression is mocking is for unit testing, not UI testing.  But maybe someone can explain how to use mocking for UI testing:</p>

<ul>
<li><p>a) Suppose an external dependency is initialized deep in the call stack.  If I define a mock in my test code's setup function (e.g. a method annotated with @Before), how do I pass that down to the place in the code that depends on it?</p></li>
<li><p>b) I keep reading that mocks don't work in Kotlin because Kotlin defines all classes as final.  There seem to be a few work arounds.  But does does Google/Android officially recommend one of these (I haven't read it in their documentation).</p></li>
</ul></li>
<li><p><strong>Dependency Injection such as Dagger 2:</strong>  If mocking isn't viable for UI testing, then should I use Dependency Injection?  From what I understand, it seems Dagger 2 deals with issue 1.a above by defining a top-level Component and a tree of Modules which can provide dependencies at any layer of the stack.  For testing, it seems like I would just provide a different Component that emulates the real dependencies.  </p>

<ul>
<li>a) In an Android instrumented test, where do instantiate a Dagger 2 Component designed for testing.  How do I make sure that Component is used rather than the Component intended for production?</li>
</ul></li>
<li><p><strong>Prepare before launching test:</strong>  I can see how I could customize build.gradle to prepare my test environment before my application is launched.  For example, I could pass a flag to my app so that when the Application's onCreate() gets called, I can configure my system to prepare emulated dependencies via Dependency Injection, Mocking, or even just a custom implementation.  For example, some external dependencies have a test mode where I would need to pass a flag to them so they work in test mode.  I'm not clear how that sort of thing reconciles with Dependency Injection or Mock but I guess I could see how I could use those mechanisms as a wrapper to pass the test flag or not.  In the following post someone wanted to mock a location provider and to do that they modified their build.gradle file to set things up before the Android test infrastructure started.
<a href=""https://stackoverflow.com/questions/39753097/how-to-set-allow-mock-location-on-android-device-before-executing-androidtest-wi/39765423#39765423"">How to set Allow Mock Location on Android Device before executing AndroidTest with uiautomator and espresso?</a></p></li>
</ol>

<p>In conclusion, I want to test a Kotlin Android app's UI using Android instrumented test with Espresso but I don't know how to setup the test so that external dependencies use emulation code rather than production code.  Should I use mocking, Dependency Injection, or customize via build.gradle?  Can someone help me get my thinking on track?</p>
",https://stackoverflow.com/questions/57011143/how-to-initialize-emulated-external-dependencies-in-a-kotlin-android-ui-test,"['android', 'kotlin', 'dependency-injection', 'mockito', 'dagger-2']",249,True,1,1
"Xcode 11 Export for Localization not working, Include Screenshots feature disabled, and can not find XCUITest screenshot attachments in the test logs","<p>I'm having trouble exporting screenshots using the 'export for localization' feature on Xcode 11.
I'm currently working on creating XCUITest suites where I test a certain UI feature of an app, and I want to take screenshots of every page of the app as each test case pass.</p>

<p>I'm using xctestplan, and under Shared Settings->Configurations->UI Testing, I have</p>

<ul>
<li>Automatic Screenshots = On </li>
<li>Localization Screenshots = On </li>
<li>Attachments = On, and keep all</li>
</ul>

<p>However, after I run my tests, when I select Editor->Export for Localization, I can not select 'Include Screenshots'. Also, it gives me a yellow warning sign with text like ""Screenshot for Localization Issue.""</p>

<p>Also, after the tests pass, I can locate the images screenshot.png as attachments listed in the Report Navigator, as well as screenshots taken with title ""Localization screenshot"", but currently I have no way to export them unless I manually go through it one by one and save each file by right click.</p>

<p>I want to be able to export these screenshots and collect them on a designated directory folder without manually going through all of them to save each image.</p>

<p>I have tried:
 1. clean build folder, delete logs in Derived data
    /users/'ID'/Developer/Xcode/DerivedData 
 2. run it under UItests scheme as well as the actual app scheme (the executable one) 
 3. delete all contents and settings on simulator, quit Xcode and restart Mac then restart Xcode</p>
",https://stackoverflow.com/questions/58278812/xcode-11-export-for-localization-not-working-include-screenshots-feature-disabl,"['xcode', 'screenshot', 'xctest', 'xcuitest', 'xctestplan']",785,True,4,1
mocha testing Angular (typescript) app that uses OpenLayers 6 fails with &#39;turf mocha &quot;syntaxError: Unexpected token {&quot;&#39;,"<p><strong>I solved this during the writing of the question and have provided my answer below since it was a bit tricky to work out.  I am happy to hear any better or alternative answers.</strong></p>

<p>I have an Angular OpenLayers 6 geomapping app.  Being Angular I use Typescript and it transpiles and runs fine.  And also being Angular it uses <code>ng test</code> to do the testing.  All tests run fine.</p>

<p>However I use mocha + chai for testing in the IDE (IntelliJ) since I don't require UI testing for the mathematical work I'm currently performing (<code>ng test</code> runs the UI tests if and when I need that.  But in the IDE I select the tests to run).  Testing this way worked fine until I added a new test that creates a new instance of a class that imports <code>GeoJSON</code>:</p>

<pre><code>import GeoJSON from 'ol/format/GeoJSON';
</code></pre>

<p>That test fails (in mocha) with:</p>

<pre><code>/home/smx9b6/dev/ng-eow/node_modules/ol/format/GeoJSON.js:17
import { assert } from '../asserts.js';
   ^

SyntaxError: Unexpected token {
</code></pre>

<p>Looking at the GeoJSON.js file it seems to have <code>UMD</code> module format (i think this is <code>UMD</code>):</p>

<pre><code>/**
 * @module ol/format/GeoJSON
 */
var __extends = (this &amp;&amp; this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array &amp;&amp; function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();

import { assert } from '../asserts.js';
import Feature from '../Feature.js';

var GeoJSON = /** @class */ (function (_super) {
    __extends(GeoJSON, _super);
    /**
     * @param {Options=} opt_options Options.
     */
    function GeoJSON(opt_options) {
        ...
    }

    GeoJSON.prototype.writeGeometryObject = function (geometry, opt_options) {
        return writeGeometry(geometry, this.adaptOptions(opt_options));
    };
return GeoJSON;
}(JSONFeature));
</code></pre>

<p>And others, such as <code>turf.js</code> use the <code>ES6</code> module format.  eg. <code>line-to-polygon</code>:</p>

<pre><code>""use strict"";
Object.defineProperty(exports, ""__esModule"", { value: true });
var bbox_1 = require(""@turf/bbox"");
var invariant_1 = require(""@turf/invariant"");
var helpers_1 = require(""@turf/helpers"");
...
function lineToPolygon(lines, options) {
    if (options === void 0) { options = {}; }
    ...
}

...

exports.default = lineToPolygon;
</code></pre>

<p>Mocha can't deal with this but Angular can - I don't know why.  I run mocha with (as reported by IntelliJ when running the test - full paths removed):</p>

<pre><code>node node_modules/mocha/bin/_mocha --require ts-node/register --ui bdd --reporter mochaIntellijReporter.js 
src/app/geometry-ops.spec.ts --grep ""^geometry-ops centroid ""
</code></pre>

<p>I have <code>commonjs</code> set as the module type:</p>

<pre><code>{
  ""extends"": ""./tsconfig.json"",
  ""compilerOptions"": {
    ""outDir"": ""./out-tsc/app"",
    ""types"": [],
    ""resolveJsonModule"": true,
    ""module"": ""commonjs"",
    ""esModuleInterop"": true,
    ""allowSyntheticDefaultImports"": true
  },
  ...
}
</code></pre>

<p>The error in full is:</p>

<pre><code>/home/smx9b6/dev/ng-eow/node_modules/ol/format/GeoJSON.js:17
import { assert } from '../asserts.js';
       ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.&lt;anonymous&gt; (/home/smx9b6/dev/ng-eow/src/app/layers-geometries.ts:4:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Module.m._compile (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:439:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:442:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.&lt;anonymous&gt; (/home/smx9b6/dev/ng-eow/src/app/geometry-ops.spec.ts:13:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Module.m._compile (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:439:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/home/smx9b6/dev/ng-eow/node_modules/ts-node/src/index.ts:442:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at /home/smx9b6/dev/ng-eow/node_modules/mocha/lib/mocha.js:334:36
    at Array.forEach (&lt;anonymous&gt;)
    at Mocha.loadFiles (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/mocha.js:331:14)
    at Mocha.run (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/mocha.js:809:10)
    at Object.exports.singleRun (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/run-helpers.js:108:16)
    at exports.runMocha (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/run-helpers.js:142:13)
    at Object.exports.handler.argv [as handler] (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/run.js:292:3)
    at Object.runCommand (/home/smx9b6/dev/ng-eow/node_modules/mocha/node_modules/yargs/lib/command.js:242:26)
    at Object.parseArgs [as _parseArgs] (/home/smx9b6/dev/ng-eow/node_modules/mocha/node_modules/yargs/yargs.js:1087:28)
    at Object.parse (/home/smx9b6/dev/ng-eow/node_modules/mocha/node_modules/yargs/yargs.js:566:25)
    at Object.exports.main (/home/smx9b6/dev/ng-eow/node_modules/mocha/lib/cli/cli.js:68:6)
    at Object.&lt;anonymous&gt; (/home/smx9b6/dev/ng-eow/node_modules/mocha/bin/_mocha:10:23)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
</code></pre>

<p>I worked out and provide an answer below.  However I would still like to hear any feedback on this.  Such as should OpenLayers change their module format?  (I'm still getting my head around all the different module formats).</p>
",https://stackoverflow.com/questions/59404074/mocha-testing-angular-typescript-app-that-uses-openlayers-6-fails-with-turf-m,"['javascript', 'angular', 'typescript', 'mocha.js', 'openlayers']",279,True,0,1
How to mock network layer responses for automated Android Studio UI Espresso test suite?,"<p>My goal is to run a suite of Espresso UI Tests, and have the Retrofit instance that has been created in the <code>onCreate</code> method of my MainActivity reconfigured to return mocked JSON responses from <code>localhost</code>, so I can test how the app's UI responds to response codes and different JSON data, etc. </p>

<p>So far, I've tried to drop in the <code>MockWebServer</code> package, and I was able to get that up and running on a localhost server. However, the Retrofit instance was still configured to the production url. </p>

<p>I've tried passing arguments at the launch of a test, including manually setting the intent for the MainActivity with some <code>extras</code>, in an attempt to set a flag that could toggle the string used for the Retrofit instance. However, it seems that the any arguments set in <code>@Before</code> of a test don't get picked up at the launch of the MainActivity. </p>

<p>I've looked at these answers, but there doesn't appear to be a solution:</p>

<p><a href=""https://stackoverflow.com/questions/44904673/android-espresso-ui-test-with-mocked-retrofit-api"">Android Espresso UI Test with mocked Retrofit API</a></p>

<p><a href=""https://stackoverflow.com/questions/41386652/mock-server-requests-android-espresso-ui-testing"">Mock server requests Android Espresso UI Testing</a></p>

<p>This is my latest experiment:</p>

<pre><code>@get:Rule
    var activityRule = ActivityTestRule(MainActivity::class.java, true, false)

    @Before
    fun setup() {

    }

    @Test
    fun intent() {
        val intent = Intent()

        activityRule.launchActivity(intent.putExtra(""UITesting"", true))

        println(activityRule.activity.intent.extras)
    }
</code></pre>

<p>Here is the Retrofit instance:</p>

<pre><code>var BASE_URL = ""https://api.invoicehome.com""

class NetworkManager {

    private val service : networkService
    // initialization with BASE_URL, using Gson converter factory to decode ( i believe there are other options available as well)
    init {
        val retrofit = Retrofit.Builder()
            .baseUrl(BASE_URL)
            .addConverterFactory(GsonConverterFactory.create())
            .build()
        service = retrofit.create(networkService::class.java)
//    }
    }
 }
</code></pre>

<p>Beginning of MainActivity, where there's an instance of the <code>NetworkManager</code>:</p>

<pre><code>class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {

    private var networkManager = NetworkManager()
}
</code></pre>

<p>I would like something that could simply wrap around the instance of Retrofit, and pop in a URL, but I'm 99% sure this isn't realistic. If any swift devs are looking at this, I'm looking for analogous functionality to <code>Swifter</code>.</p>

<p>So, can I somehow make the URL conditional for the Retrofit instance? Where would I pass in these flags? Is there a library that I'm missing that can do all of this for me?</p>
",https://stackoverflow.com/questions/56094347/how-to-mock-network-layer-responses-for-automated-android-studio-ui-espresso-tes,"['android', 'testing', 'mocking', 'retrofit', 'uitest']",2560,True,0,1
Revert ToggleButton IsChecked state after user taps it,"<p>Let's say you want to have a UI which is equivalent to that of a VCR's or portable audio cassette player's playback controls. You could have a few states: playing, fast forward/rewind, stopped, etc. You could represent these states as toggle buttons, and you want to do this in an MVVM fashion, so you'll bind <code>IsChecked</code>. In my particular case, we've opted to bind <code>IsChecked</code> as <code>OneWay</code> and also bind the <code>Tapped</code> event to a method on the (view)model. The Tapped event handler is what does the actual work when the user requests a state change, i.e. action to perform.</p>

<p>This all works great until you try to immediately undo a requested action or state change. Using the cassette example, let's say I want to rewind or play, but there is no cassette in the player. The buttons need to remain visually in the stopped state, not the play/rewind state. We can't disable the buttons because we tell the user <em>why</em> that action cannot be performed as they try to perform it.</p>

<p>To accomplish that, I thought I could simply raise <code>PropertyChanged</code> and get the buttons to reevaluate their state. Doesn't work. Even if I notify after awaiting an async call to show a modal, it doesn't work. Implementing it as a retemplated <code>ItemsControl</code> using <code>SelectedItem</code> doesn't work any better. There doesn't appear to be a way to intercept the event and mark it as handled. I don't want to resort to some <code>Task.Delay</code> trickery. What other options do I have? I could implement separate button styles/states using a standard Button and throw out <code>ToggleButton</code>s altogether, but I'm curious if that has some sort of consequence for automated UI testing or accessibility.</p>
",https://stackoverflow.com/questions/58828794/revert-togglebutton-ischecked-state-after-user-taps-it,"['c#', 'uwp']",52,True,0,2
Espresso pauses on an activity started from a third party library,"<p>I am trying to do some ui testing using espresso, but when it gets into an activity that is created through the library, the espresso does not do anything. It looks like the espresso pauses and waits until the library activity finishes and resumes the rest commands.</p>

<p><b>Test Class: </b></p>

<p>Here is what I have for the test class.</p>

<pre><code>@RunWith(AndroidJUnit4.class)
public class MainActivityTest{

  @Rule
  public ActivityTestRule&lt;MainActivity&gt; activityTestRule =
    new ActivityTestRule&lt;&gt;(MainActivity.class);

  @Test
  public void startTest) throws Exception {
    // starts KEYBOARD_ACTIVITY
    onView(withId(R.id.button_start)).perform(click());

    // test pauses here!!

    // pressBack supposed to go back to MainActivity,
    // but this doesnt do anything either
    // pressBack();

    // click random coordinates several times
    onView(withId(R.id.KEYBOARDAREA)).perform(clickXY(randomCoordinates));


    // This supposed to finish the KEYBOARD_ACTIVITY and go back to MainActivity
    onView(withId(R.id.button_done)).perform(click());

  }
</code></pre>

<p>The problem is that the test pauses right after <i>button_start</i> clicked and if I don't do anything, test fails within a minute or so by timeout (?), Or if I quit the KEYBOARD_ACTIVITY, the test resumes, and puts nullpointer exception error since R.id.KEYBORDAREA is gone.</p>

<p><b>About Library: </b></p>

<p>I have MainActivity with a button that starts a new activity using the following code in the MainActivity:</p>

<pre><code>Intent intent = KEYBOARD_ACTIVITY.makeIntent(MainActivity.this, params);
startActivityForResult(intent, REQUEST);
</code></pre>

<p>Since the .aar library, which is already added as a module dependency, creates an activity by itself with the params, I do not have the activity class file inside the project; instead, I add <i>activity</i> in AndroidManifest.xml just like adding other activities. During the Keyboard activity, the user is supposed to touch the keypad and finally tap ""finish"", then the result goes back to MainActivity and shows the result.</p>

<p>The library is composed with some C files using jni, which encrypts the user input, and Java codes that handles appearances, parameters, activities, etc.</p>

<p><b>What I've done so far: </b></p>

<ol>
<li><p>I tried to start testing from the KEYBOARD_ACTIVITY by having the Rule:</p>

<p>@Rule
public ActivityTestRule activityTestRule =
    new ActivityTestRule&lt;>(KEYBOARDACTIVITY.class)</p></li>
</ol>

<p>But it gives nullPointerException error saying <i>attempt to invoke virtual method</i>.</p>

<ol start=""2"">
<li>I tried UiAutomator as well but it paused and resumed just like espresso did.</li>
</ol>

<p>Has anyone experienced anything like this? Like espresso doing nothing on an activity called from external library?
Or does anyone know anything about espresso's levels of access authority of other activities, if such thing exists? Or maybe there is such thing like espresso's ""focus"" of testing activity.</p>
",https://stackoverflow.com/questions/55702311/espresso-pauses-on-an-activity-started-from-a-third-party-library,"['android', 'android-espresso', 'ui-testing']",160,False,2,0
WPF coded UI test randomly fails with weird ArgumentException,"<p>I have coded UI tests in WPF application and they occasionally fail with the following exception:</p>

<blockquote>
  <p>Message: Test method MyMethodNameGoesHere threw exception: 
  System.ArgumentException: Parameter is not valid.</p>
</blockquote>

<p>and StackTrace:</p>

<pre><code>at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at Microsoft.VisualStudio.TestTools.UITesting.LoggerUtility.GetDesktopImage()
at Microsoft.VisualStudio.TestTools.UITesting.LoggerUtility.CaptureScreenShotAndDrawBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 borderWidth, Boolean isActualControlBounds)
at Microsoft.VisualStudio.TestTools.UITest.Extension.LoggerUtilities.CaptureScreenShotAndDrawBounds(Rectangle bounds, Int32 borderWidth, Boolean isActualControlBounds)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.CaptureScreenShot(UITestControl control)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.GetUITestControlString(UITestControl control)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32&amp; timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.&lt;Find&gt;b__175_0()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Find()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyPrivate(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyOfType[T](String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.get_Exists()
at MyProjectNamespace.UITests.TestButtonExists() in E:\...\UITests.cs:line 177
</code></pre>

<p>Any code that tries to access properties of <code>UITestControl</code> like <code>Exists</code>, <code>Checked</code> or <code>Selected</code> throws it. For example:</p>

<pre><code>WpfButton button = UIControlBuilder&lt;WpfButton&gt;.Builder()
    .Parent(MainPane)
    .AutomationID(MyButtonId)
    .Build();

// ...    

Assert.IsTrue(button.Exists);
</code></pre>

<p>Interestingly, this issue happens randomly, but with some pattern. If I run tests one by one, then they work well. If I run many tests in row, then after some time one test fails and then all consequent tests fail too. I thought that it could be a memory-related issue (leakage or out of memory), but I definitely have lots of memory available and processes don't seem to consume much of it. </p>

<p>From my investigation UI test framework catches an exception in <code>FindFirstDescendant</code> and tries to capture a screenshot to report this exception, but fails to do this too:</p>

<pre><code>// decompiled UI test framework's UITestControl.cs code
internal UITestControl FindFirstDescendant(string queryId, int maxDepth, ref int timeLeft)
{
    // ...
    try
    {
        element = this.ScreenElement.FindScreenElement(queryId, maxDepth);
    }
    catch (Exception ex) // catches exception here
    {
        // but this method does also throw exception, because of a bug:
        Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(ex, queryId); 
        throw;
    }
}
</code></pre>

<p>Even more interesting that this is a very generic error which happens in the constructor of .NET's <code>Bitmap</code> (invalid width or height parameter?). </p>

<p>Because of this <code>Bitmap</code> issue I can't get the original exception, so I can't understand what happens. <code>Playback.CaptureScreenShot</code> is marked with compiler warning suppression attribute, which clearly specifies that this method shouldn't throw any exceptions.<br>
Is this a bug in UI testing framework? </p>

<p>One more interesting observation. It creates screenshots in my test directory, but the application's window is highlighted incorrectly on screenshots. This is how it looks like. Red is my display setup, blue is where the main window actually is, green is how WPF highlights on test result screenshot: </p>

<p><a href=""https://i.stack.imgur.com/txmmH.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/txmmH.png"" alt=""How screenshot looks like""></a></p>

<p>The distance of green narrow line and blue narrow line for corners are equal, so for me it seems like like it takes the application's window's offset within single main display, but then it tries to take a screenshot by applying the offset to all displays. 
Can it be a cause of a bug (like going out of display's bounds) or is it just another thing?</p>
",https://stackoverflow.com/questions/54911910/wpf-coded-ui-test-randomly-fails-with-weird-argumentexception,"['c#', 'wpf', 'exception', 'coded-ui-tests', 'base-class-library']",138,True,1,1
Test to see if a given iPhone supports a split view in expanded mode,"<p>On iPhone 6 (and smaller) the phone never displays a split view in ""expanded"" mode. That is, the primary and secondary view controllers inside the split view are always shown sequentially. In contrast, on iPhone 6Plus (and larger) the phone will show split views in expanded mode when in landscape orientation. That is, the primary and secondary view controllers are shown side-by-side.</p>

<p>This creates a problem for UI Tests. When the device is a phone and the horizontal size class is Compact (iPhone 6 and smaller) then there should have one set of tests. When the device is a phone and the horizontal size class is Regular then there should be a separate set of tests.</p>

<p>Unfortunately, I haven't been able to discover a test for size classes when dealing with UIElements in UITests. Is there a way to get traitCollection information when performing UI Testing?</p>

<p>The UIDevice object has a ""model"" property. This is a string. When testing on the Simulator the only values I have seen from this property is ""phone"" or ""pad"". A phone's model-number does not seem to be available and Apple's documentation does not guarantee any particular value.</p>

<p>The UIDevice object also has a userInterfaceIdiom property. This enum can report things like CarPlay and Apple TV in addition to pad and phone, but again does not return any model-number information.</p>

<p>XCUIDevice does not report either trait environment or model-number.</p>

<p>My work-around is to insert test code inside my main project. In the opening scene I give one of the elements an accessibility identifier that reflects the initial horizontal size class. If there is a title, for example then the accessibility identifier become ""title (compact)"" or ""title (regular)"". This can be interrogated in UI Tests during setup and a global variable can be set for later use. It is a pretty poor kludge, however.</p>

<p>I'm hoping that someone knows of an object (accessible in UI Tests) that will return something like:</p>

<pre><code>&lt;some object&gt;.supportsSplitViewInExandedMode
</code></pre>

<p>That would be great!</p>
",https://stackoverflow.com/questions/57332416/test-to-see-if-a-given-iphone-supports-a-split-view-in-expanded-mode,"['ios', 'swift', 'uisplitviewcontroller', 'uitest', 'uitraitcollection']",97,False,0,1
What is the best way to run selenium tests in AWS CI/CD pipeline,"<p>I have been assigned a task to integrate the the automation test that I developed to the a AWS CI/CD pipeline, I was researching on how to achieve this task for a while now. After doing some research I found out that a lot of people have used tools like Jenkins/ Docker to achieve this task, even after doing all the research Im still confused on what is the best way to achieve this, here are some of the documents that I found,</p>

<p><a href=""http://www.testautomationguru.com/selenium-webdriver-how-to-run-automated-tests-inside-a-docker-container/"" rel=""noreferrer"">http://www.testautomationguru.com/selenium-webdriver-how-to-run-automated-tests-inside-a-docker-container/</a></p>

<p><a href=""https://www.pawangaria.com/post/docker/how-to-use-docker-with-webdriver/"" rel=""noreferrer"">https://www.pawangaria.com/post/docker/how-to-use-docker-with-webdriver/</a></p>

<p><a href=""https://aws.amazon.com/blogs/devops/using-aws-codepipeline-aws-codebuild-and-aws-lambda-for-serverless-automated-ui-testing/"" rel=""noreferrer"">https://aws.amazon.com/blogs/devops/using-aws-codepipeline-aws-codebuild-and-aws-lambda-for-serverless-automated-ui-testing/</a></p>

<p><a href=""https://dzone.com/articles/qa-automation-pipeline-learn-how-to-build-your-own-1"" rel=""noreferrer"">https://dzone.com/articles/qa-automation-pipeline-learn-how-to-build-your-own-1</a></p>

<p>What Im supposed to do is, once the web application the developers are working on is deployed through the pipeline, I will have to run the selenium test through the pipeline to check if the web application is deployed properly. (This is where I need some clarification on what is the best way to achieve this)</p>

<p>I built a maven project with the selenium scripts to check content on the web application for now I have used a dummy url in the scripts, here is the maven project </p>

<p><a href=""https://github.com/nimeshdilshan96/pipeline-script-test.git"" rel=""noreferrer"">https://github.com/nimeshdilshan96/pipeline-script-test.git</a> </p>

<p>This is what I have done up-to now, </p>

<ul>
<li>I have a docker container running in my local PC (this is the docker image that i used <a href=""https://hub.docker.com/r/selenium/standalone-chrome"" rel=""noreferrer"">https://hub.docker.com/r/selenium/standalone-chrome</a>)</li>
<li>I have the maven project which runs the tests on the docker container </li>
</ul>

<p>At this point Im really confused and stuck on what should be done, here are some questions Im looking answers for,</p>

<ul>
<li>What is the best way to run selenium tests on a CI/CD pipeline?</li>
<li>Should the maven project run separately or within the docker container?</li>
<li>Should the docker container only act as the environment in which tests are executed? </li>
</ul>

<p>Any help would be appreciated, thanks in advance :) </p>
",https://stackoverflow.com/questions/54822954/what-is-the-best-way-to-run-selenium-tests-in-aws-ci-cd-pipeline,"['selenium', 'docker', 'continuous-integration', 'continuous-deployment', 'aws-codepipeline']",13099,True,5,2
Confirm an element no longer exists using complete non-XPath path before continuing,"<p>I'm doing some desktop application testing using Winium with Python.  For my application, I'm first confirming the progress bar appears on the windows with some other text.  I'm then confirming the progress bar no longer exists before continuing forward.</p>

<pre><code>running_app = driver.find_element_by_name(""MyApp"")
status_bar = running_app.find_element_by_id(""statusStrip1"")
status_bar.find_element_by_class_name(""WindowsForms10.msctls_progress32.app.0.141b42a_r9_ad1"")
status_bar.find_element_by_name(""Loading Default Files..."")

# Confirm Progress Bar disappears before continuing
WebDriverWait(driver, 60).until_not(
     expected_conditions.presence_of_element_located((eval(""By.CLASS_NAME""), ""WindowsForms10.msctls_progress32.app.0.141b42a_r9_ad1""))
)
</code></pre>

<p>The issue I'm having is with the portion of the code that's meant to verify the Progress Bar has disappeared before continuing on.  That particular line takes too long to execute.  After some investigation, I concluded this is happening because I'm only able to feed the component address into 'presence_of_element_located' as opposed to its full address, which would look something like...</p>

<pre><code>driver.find_element_by_name(""MyApp"").find_element_by_id(""statusStrip1"").find_element_by_class_name(""WindowsForms10.msctls_progress32.app.0.141b42a_r9_ad1"")
</code></pre>

<p>Unfortunately, I have no way of breaking this down into an XPath and using that instead.  To the best of my knowledge, I don't know of a way to retrieve the XPath of an object using this address either.  I'd like to find either a way to make to either.. (1) Insert this absolute/full address into expected_conditions.presence_of_element_located() or find an alternate way to confirm the object no longer exists.</p>

<p><strong>- 20190502 UPDATE -</strong></p>

<p>So far the closest I've come to a solution is combining the ideas below:</p>

<pre><code>WebDriverWait(driver, 15).until(
    expected_conditions.invisibility_of_element_located((eval(""By.XPATH""), ""//*[@name='MyApp']//*[@id='statusStrip1']//*[@class='WindowsForms10.msctls_progress32.app.0.141b42a_r9_ad1']""))
)
</code></pre>

<p>This does get me past confirming the Progress Bar has vanished so the test can continue.  It also has the same timing issue as the wildcards mean the object has to be searched for first.</p>

<p><strong>- 20190502 UPDATE (2) -</strong></p>

<p>So, I had a bit of a breakthrough as to figuring out this puzzle.  For using XPath, if I was doing Web UI testing, I can look at the XML code and see that it's a '//div', '//table', '//input', '//tspn', etc..  I've been using the UISpy tool to figure out the names of objects on my desktop application.  As I was looking at it, I became curious about the labels in front of the object it's referencing.</p>

<p><a href=""https://i.stack.imgur.com/8PCgs.jpg"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/8PCgs.jpg"" alt=""enter image description here""></a></p>

<p>From the Control View, I see 'MyApp' has the label 'Window' next to it.  So I decided to use that to alter my XPath attempt to the following:</p>

<pre><code>WebDriverWait(driver, 15).until(
    expected_conditions.invisibility_of_element_located((eval(""By.XPATH""), ""//window[@name='MyApp']//*[@id='statusStrip1']//*[@class='WindowsForms10.msctls_progress32.app.0.141b42a_r9_ad1']""))
)
</code></pre>

<p>Not only did that work, but it was a tiny bit faster than the previous tries.  The problem is the next layer is labeled as 'Status Bar' and I'm not really sure how to represent that in XPath.</p>
",https://stackoverflow.com/questions/55928864/confirm-an-element-no-longer-exists-using-complete-non-xpath-path-before-continu,"['python', 'python-2.7', 'selenium', 'selenium-webdriver', 'winium']",452,False,0,1
Xamarin UI Test on Local Android device not launching app,"<p>I’m struggling to get my UI Testing working on Android locally.</p>

<p>I’m using the APK which was archived as a release build with no shared runtimes and using the correct ABI apk in my build.</p>

<pre><code>return ConfigureApp.Android
                    .EnableLocalScreenshots()
                    .PreferIdeSettings()
                    .ApkFile(ApkPath)
                    .StartApp(Xamarin.UITest.Configuration.AppDataMode.DoNotClear);
</code></pre>

<p>I can see it connect to my physical phone device:</p>

<blockquote>
  <p>15-04-2019 10:28:57.423 +02:00 - 309 - QueryAdbDevices devices output:  [ ""21f563e0550d7ece                device"" ]
  15-04-2019 10:28:57.454 +02:00 - 340 - QueryAdbDevices found attached devices:  [ ""21f563e0550d7ece"" ]
  15-04-2019 10:28:57.467 +02:00 - 353 - Initializing Android app on device 21f563e0550d7ece with apk: ******
  15-04-2019 10:28:57.809 +02:00 - 695 - Signing apk with Xamarin keystore.</p>
</blockquote>

<p>I can see it deploy the app APK:</p>

<blockquote>
  <p>-2019 10:28:59.805 +02:00 - 2691 - AdbArguments: '-s **** shell am instrument -e ""target_package"" ""****"" -e ""debug"" ""false"" -e ""test_server_port"" ""50860"" -e ""class"" ""sh.calaba.instrumentationbackend.InstrumentationBackend"" ******test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner'.
  15-04-2019 10:29:00.513 +02:00 - 3399 - Finished with exit code 0 in 703 ms.</p>
</blockquote>

<p>I can also see it deploy the additional helper APKs:</p>

<blockquote>
  <p>15-04-2019 10:29:00.518 +02:00 - 3403 - launchable activity set as 
  15-04-2019 10:29:00.521 +02:00 - 3407 - AdbArguments: '-s ***** forward tcp:50860 tcp:50860'.
  15-04-2019 10:29:00.567 +02:00 - 3453 - Finished with exit code 0 in 40 ms.
  15-04-2019 10:29:00.572 +02:00 - 3458 - Forwarded port 50860.</p>
</blockquote>

<p>And then after this it just tries to ping the application, which then doesn’t launch on the device:</p>

<blockquote>
  <p>15-04-2019 10:29:00.656 +02:00 - 3542 - HTTP POST { Url: { AbsolutePath: ""/ping"", AbsoluteUri: ""<a href=""http://127.0.0.1:50860/ping"" rel=""nofollow noreferrer"">http://127.0.0.1:50860/ping</a>"", LocalPath: ""/ping"", Authority: ""127.0.0.1:50860"", HostNameType: IPv4, IsDefaultPort: False, IsFile: False, IsLoopback: True, PathAndQuery: ""/ping"", Segments: [ ""/"", ""ping"" ], IsUnc: False, Host: ""127.0.0.1"", Port: 50860, Query: """", Fragment: """", Scheme: ""http"", OriginalString: ""<a href=""http://127.0.0.1:50860/ping"" rel=""nofollow noreferrer"">http://127.0.0.1:50860/ping</a>"", DnsSafeHost: ""127.0.0.1"", IdnHost: ""127.0.0.1"", IsAbsoluteUri: True, UserEscaped: False, UserInfo: """" } }</p>
  
  <p>15-04-2019 10:29:00.917 +02:00 - 3803 - HTTP POST { Url: { AbsolutePath: ""/ping"", AbsoluteUri: ""<a href=""http://127.0.0.1:50860/ping"" rel=""nofollow noreferrer"">http://127.0.0.1:50860/ping</a>"", LocalPath: ""/ping"", Authority: ""127.0.0.1:50860"", HostNameType: IPv4, IsDefaultPort: False, IsFile: False, IsLoopback: True, PathAndQuery: ""/ping"", Segments: [ ""/"", ""ping"" ], IsUnc: False, Host: ""127.0.0.1"", Port: 50860, Query: """", Fragment: """", Scheme: ""http"", OriginalString: ""<a href=""http://127.0.0.1:50860/ping"" rel=""nofollow noreferrer"">http://127.0.0.1:50860/ping</a>"", DnsSafeHost: ""127.0.0.1"", IdnHost: ""127.0.0.1"", IsAbsoluteUri: True, UserEscaped: False, UserInfo: """" } } </p>
</blockquote>

<p>I'm using the following versions:</p>

<p>Android test running Xamarin.UITest version: 2.2.7</p>

<p>NUnit v2.6.4</p>

<p>NUnit adaptor v2.1.1</p>

<p>Visual Studio 2019 v15.9.11</p>
",https://stackoverflow.com/questions/55685919/xamarin-ui-test-on-local-android-device-not-launching-app,"['xamarin', 'xamarin.android']",843,False,2,0
".NET Core, VS2019, and Selenium: IE Driver Doesn&#39;t Work (WebDriverException - HTTP request timeout)","<p><strong>UPDATE:</strong> This error only happens in Visual Studio 2019. I'm on 16.3.1 Community. Visual Studio 2017 works just fine and causes no issues. So it seems the crux of the issue lies in Visual Studio 2019 for some reason.</p>

<p><strong>NOTE</strong> that no matter which IDE I build it in, <code>dotnet run</code> will fail just like VS2019 does. Only if I run the app within VS2017 does it work.</p>

<p>I <a href=""https://developercommunity.visualstudio.com/content/problem/748198/selenium-iedriverserver-fails.html"" rel=""nofollow noreferrer"">cross-posted this to Microsoft</a> via Visual Studio's built-in ""Report a Problem"" menu to attack this issue from multiple angles. I'll report back if/when they do anything (i.e. if they identify it as an issue with Visual Studio).</p>

<hr>

<p>We've recently upgraded from .NET Framework to .NET Core. The application presently runs on .NET Core 2.2, but the same issues occur on .NET Core 3.0.</p>

<p>We run Selenium for UI testing, and for some reason, Internet Explorer's tests are quite wonky. The driver successfully launches the browser, but the first <code>Navigate()</code> call hangs indefinitely after it successfully performs navigation (never gets beyond that line of code). Here's the full stack trace:</p>

<blockquote>
  <p>OpenQA.Selenium.WebDriverException
  HResult=0x80131500</p>
  
  <p>Message=The HTTP request to the remote WebDriver server for URL <a href=""http://localhost:52211/session/9e1e828b-5e72-46d8-8012-6b29bfc2d854/url"" rel=""nofollow noreferrer"">http://localhost:52211/session/9e1e828b-5e72-46d8-8012-6b29bfc2d854/url</a> timed out after 10 seconds.
    Source=WebDriver</p>
  
  <p>StackTrace:
     at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)</p>
  
  <p>at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)</p>
  
  <p>at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)</p>
  
  <p>at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)</p>
  
  <p>at OpenQA.Selenium.Remote.RemoteWebDriver.set_Url(String value)</p>
  
  <p>at SandboxSelenium.Program.Main(String[] args) in C:\dev_sandbox\SandboxSelenium\SandboxSelenium\Program.cs:line 17</p>
  
  <p>Inner Exception 1: WebException: The operation has timed out.</p>
</blockquote>

<p>For simplicity, I created a brand new .NET Core Console App, and did nothing in Main except repeat the above step, and I recreated the issue.</p>

<p>Here are the whole csproj of the console app project, including package references:</p>

<pre><code>&lt;Project Sdk=""Microsoft.NET.Sdk""&gt;
  &lt;PropertyGroup&gt;
    &lt;OutputType&gt;Exe&lt;/OutputType&gt;
    &lt;TargetFramework&gt;netcoreapp2.2&lt;/TargetFramework&gt;
  &lt;/PropertyGroup&gt;

  &lt;ItemGroup&gt;
    &lt;PackageReference Include=""Selenium.WebDriver"" Version=""3.141.0"" /&gt;
    &lt;PackageReference Include=""Selenium.WebDriver.IEDriver"" Version=""3.150.0"" /&gt;
  &lt;/ItemGroup&gt;
&lt;/Project&gt;
</code></pre>

<p>And here's the code I'm calling:</p>

<pre><code>using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using System;
using System.IO;
using System.Reflection;

namespace SandboxSelenium
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            string binPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); // In .NET Core you have to tell Selenium where the EXE is.
            InternetExplorerOptions opts = new InternetExplorerOptions();
            using (var driver = new InternetExplorerDriver(binPath, opts, new TimeSpan(0, 0, 10)))
            {
                driver.Navigate().GoToUrl(""https://example.com/""); // ""Line 17"" in above error. This line times out!
                IWebElement someTextbox = driver.FindElement(By.Id(""SomeTextBox"")); // Never gets here...
                someTextbox.SendKeys(""abc123"");
            }
        }
    }
}
</code></pre>

<p><strong>NOTE:</strong> I only set the driver's command timeout to <code>new TimeSpan(0, 0, 10)</code> (10 seconds) in order to shorten the timeout from the default 60 seconds. It times out no matter how long or short the timeout is.</p>

<p>Also, it seems the server executable, <code>IEDriverServer.exe</code>, doesn't close either and is left hanging open after the crash.</p>

<p><strong>I suspect</strong> that somehow Selenium is losing track of IE or something, since it seems to completely lose the browser itself. Not sure though. <strong>I have tried</strong> changing the <code>PageLoadStrategy</code> within <code>InternetExplorerOptions</code> for the driver, but that didn't help any. I <strong>have also tried</strong> using the 64bit NuGet package for the IE server driver, but that didn't change anything.</p>

<p>Any help is appreciated! </p>
",https://stackoverflow.com/questions/58104277/net-core-vs2019-and-selenium-ie-driver-doesnt-work-webdriverexception-ht,"['c#', 'selenium', 'internet-explorer', '.net-core', 'visual-studio-2019']",1094,True,1,3
Unable to Select a Row on a List/Table Object for Desktop App Testing Using Winium for Python,"<p>I'm using Winium with Python to automate a desktop application and came across a portion of my GUI I'm having issues automating.</p>

<p>In the process of creating a configuration, the user will have a window where they select the type of protocol to create.</p>

<p><a href=""https://i.stack.imgur.com/5YXEd.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/5YXEd.png"" alt=""enter image description here""></a></p>

<p>The issue I'm encountering is selecting a specific row within the table, via mouse click.  Since there are multiple rows with the same protocol name, I'll want to select a row based upon both the Protocol name &amp; Mode (i.e Modbus Slave).  </p>

<p>Ideally, I'd want to search the table, find the desired row based upon protocol &amp; mode, and select that row.  I've figured out how to select a row using only the Protocol name:</p>

<pre><code>driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"").find_element_by_id(""LargeIncrement"").click()
driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"").find_element_by_name(""Modbus"").click()
</code></pre>

<p>The problem I'm having is finding a way to select a row based on both parameters.  With Web UI testing, it's usually a '/td' or '/tr' object &amp; I can easily find the list/table within the HTML code and use its XPath to specify a row or a cell within a row.  That's not the case with my desktop app.  I've been trying to use both <strong>Inspect Object</strong> (Ver 7.2.0.0)...</p>

<p><a href=""https://i.stack.imgur.com/R6Oqi.jpg"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/R6Oqi.jpg"" alt=""enter image description here""></a></p>

<p>... and <strong>UISpy</strong> (Ver 3.0.0.0)...</p>

<p><a href=""https://i.stack.imgur.com/hZgY1.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/hZgY1.png"" alt=""enter image description here""></a>
<a href=""https://i.stack.imgur.com/g7HfK.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/g7HfK.png"" alt=""enter image description here""></a></p>

<p>... but haven't been able to figure out how to perform this action.  With some some research and searching, I've tried some combination of the following:</p>

<pre><code>driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"").find_elements(By.NAME)
driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"").find_elements(By.ID, ""item"")
driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"")[5]
</code></pre>

<p>I did some element digging and was able to show there are 182 Xpath objects.</p>

<pre><code>protocol_table = driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"")

all_xpath_children = protocol_table.find_elements_by_xpath("".//*"")
print ""Length:"" + str(len(all_xpath_children))
</code></pre>

<p>I'm sure there's a way to achieve this, but I'm struggling with figuring it out.  I've found very little documentation &amp; most of the help I've found has been strictly for Java.</p>

<p><strong>Update (1) 4/24/2019</strong>
I've also been looking at the items within the list separately hoping to find a way to perform this action.  Here is info of one of those items within the list/table:</p>

<p><strong>Inspect Object - Modbus Slave</strong>
<a href=""https://i.stack.imgur.com/cHh2o.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/cHh2o.png"" alt=""enter image description here""></a>
<a href=""https://i.stack.imgur.com/5dpQm.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/5dpQm.png"" alt=""enter image description here""></a>
<a href=""https://i.stack.imgur.com/p3Z9b.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/p3Z9b.png"" alt=""enter image description here""></a>
<a href=""https://i.stack.imgur.com/VLbEd.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/VLbEd.png"" alt=""enter image description here""></a></p>

<p><strong>UISpy - Modbus Slave</strong>
<a href=""https://i.stack.imgur.com/qI8rM.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/qI8rM.png"" alt=""enter image description here""></a>
<a href=""https://i.stack.imgur.com/fOON1.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/fOON1.png"" alt=""enter image description here""></a>
<a href=""https://i.stack.imgur.com/w601G.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/w601G.png"" alt=""enter image description here""></a>
<a href=""https://i.stack.imgur.com/b0e7l.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/b0e7l.png"" alt=""enter image description here""></a></p>

<p><strong>Update (2) 4/24/2019</strong>
I found something that works somewhat.  I noticed in the screenshots above for both Inspect &amp; UISpy, when clicking on a single item present in the table, it showed the 'LocalizedControlType' was equal to 'text'.  So I started testing different possibilities using that parameter and the success I had with XPath above.  I discovered that all 3 options below are capable of selecting the Modbus Slave line in the table:</p>

<pre><code>driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"").find_element_by_xpath(""(//*[@LocalizedControlType='text'])[79]"").click()
driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"").find_element_by_xpath(""(//*[@LocalizedControlType='text'])[80]"").click()
driver.find_element_by_class_name(""WindowsForms10.SysListView32.app.0.141b42a_r9_ad1"").find_element_by_xpath(""(//*[@LocalizedControlType='text'])[81]"").click()
</code></pre>

<p>Selecting object 78 results in selecting Modbus Master &amp; selecting object 82 results in selecting the next row down.  This method will work, but it would be nice to find a cleaner way of selecting a row knowing both the 'protocol' &amp; 'mode'.</p>
",https://stackoverflow.com/questions/55820156/unable-to-select-a-row-on-a-list-table-object-for-desktop-app-testing-using-wini,"['python', 'selenium', 'selenium-webdriver', 'winium']",1127,False,0,0
How to test a distributed P2P game if it can handle 100 connections?,"<p>For a big project at school we have made a P2P variant of the famous beergame. The GUI is built in JavaFX.</p>

<p>I have to do research on how to test a quality attribute scenario, which is the following:</p>

<p>100 players can connect to the game and play it.</p>

<p>Connecting to a game goes via an input in the GUI where the player needs to put the IP address (with port if its over WAN) of the host (gameleader). We are implementing RAFT as the state consensus algorithm.</p>

<p>The first step I did was researching the best possible way to create 100 clients/computers however you want to call it. I quickly came to the conclusion that Docker was about the only piece of software that could have 100 containers running simultaneously. My real problem now is how to test the application in a containerized environment.</p>

<p>I thought about it and the only real way to test the flow to play a game on each container was to walk through the UI elements with for each client other settings (every client needs to join the game with different usernames) with some kind of UI testing framework like TestFX. </p>

<p>I have found a framework that lets you test the UI, but it needs an host OS with a graphical interface to function (or at least, that's the assumption I have based on a short search on the internet). </p>

<p>Is there maybe a way to do this in IntellJ itself. Creating 100 containers of with the game with each an unique IP-address so that they can connect to the game host.</p>

<h2>Edit for @Karol Dowbecki</h2>

<p>The way we are communicating is sending serialized AppendEntries(heartbeats) every 100ms over TCP/IP with UPnP which contain changes that have to be committed (if nothing happened, then the appendentry has no logentries). So if a player does an action, it sents an AppendEntry to the leader of at that moment(gameleader/host) which then relays it back to all the other nodes and waits for the majority of the nodes to send it back (two-phase commit) after which it is added to the list of logentries of each player (all data of the game). If a new player joins the game, that player receives all of the logEntries that exist for that game in just 1 heartbeat, which is a gigantic serialized json object, after which it recalculates the steps (logEntries) from the bottom up until the last one, which is the player joined the game.</p>

<p>So what you are suggesting is capturing these serialized appendEntries that go over the network, deserialize them and compare it to the expected result? It will be very hard if I had to scan every AppendEntry, as each client sends 10 of them per second to the leader (if the client is a player) and 10 to all of the nodes (if the client is the leader/host).</p>

<p>Also the AppendEntries go back and forth. Everytime a player joins the LogIndex(the index of the LogEntries, basically the index of how many gamestate changes have occured) goes up by 1, which ultimately defines how many changes have occured in the gamestate. So its not that I am sending static information back and forth. Its changing with every joining player. Also when a player ""disconnects"" this affects the LogIndex again. I have to be able to keep track of the fact that 100 people joined the game and are still there.</p>
",https://stackoverflow.com/questions/54164427/how-to-test-a-distributed-p2p-game-if-it-can-handle-100-connections,"['java', 'testing', 'javafx', 'ui-testing', 'system-testing']",154,False,-1,1
