mkn
mkn

Reputation: 13071

Xamarin UI Test tap a dom

I have a Android Xamarin App and one view is a webview. There I need to click on a certain dom, however I failed to do so. This is tree output from console

[[object CalabashRootView] > PhoneWindow$DecorView]                                                                                                                                                                  
[ActionBarOverlayLayout] id: "decor_content_parent"
[FrameLayout] id: "content"
  [LinearLayout > ... > RendererFactory_DefaultRenderer]
    [RendererFactory_DefaultRenderer]
      [BoxRenderer]
      [RendererFactory_DefaultRenderer > ... > WebView]
        [dom] text: "mobileForm"
        [dom] id: "mobileForm:j_idt16"
        [dom] id: "mobileForm:mobileRegistrationButton"
        [dom] id: "j_id1:javax.faces.ViewState:0" text: "-4703138551000310142:8507938265923038992"
        [dom] id: "j_id1:javax.faces.ClientWindow:0" text: "hfgsYwUuZaoRWdUVIYZM7iiP:0"
        [dom] text: "locale_mobile"
        [dom] id: "j_id1:javax.faces.ViewState:1" text: "-4703138551000310142:8507938265923038992"
        [dom] id: "j_id1:javax.faces.ClientWindow:1" text: "hfgsYwUuZaoRWdUVIYZM7iiP:0"
        [dom] text: "desktopRegistration"
        [dom] id: "desktopRegistration:desktopRegistrationButton"
        [dom] id: "j_id1:javax.faces.ViewState:2" text: "-4703138551000310142:8507938265923038992"
        [dom] id: "j_id1:javax.faces.ClientWindow:2" text: "hfgsYwUuZaoRWdUVIYZM7iiP:0"
        [dom] text: "desktopLogin"
        [dom] id: "desktopLogin:usernameField"
        [dom] id: "desktopLogin:introLoginButton"
        [dom] id: "j_id1:javax.faces.ViewState:3" text: "-4703138551000310142:8507938265923038992"
        [dom] id: "j_id1:javax.faces.ClientWindow:3" text: "hfgsYwUuZaoRWdUVIYZM7iiP:0"
        [dom] text: "locale_desktop"
        [dom] id: "j_id1:javax.faces.ViewState:4" text: "-4703138551000310142:8507938265923038992"
        [dom] id: "j_id1:javax.faces.ClientWindow:4" text: "hfgsYwUuZaoRWdUVIYZM7iiP:0"
    [RendererFactory_DefaultRenderer]
      [BoxRenderer]
      [RendererFactory_DefaultRenderer]
        [RendererFactory_DefaultRenderer]
        [RendererFactory_DefaultRenderer > MonoLabelRenderer]
          [FormsTextView] text: "Login"
        [RendererFactory_DefaultRenderer]
      [BoxRenderer]
[View] id: „statusBarBackground“

The dom to be tapped is [dom] id: "mobileForm:j_idt16" Is there a certain command to do so?

Upvotes: 0

Views: 935

Answers (2)

mkn
mkn

Reputation: 13071

The source of the problem was that I had a older Xamarin.UITest version. According to Xamarin Support you need at least v1.1.0. You can find the information in the project by open the Packages folder in the tree view on the left side. There is a package called Xamarin.UITest. If you need to update it you need to right click on the Packages folder and choose Update.

Upvotes: 0

Prashant Cholachagudda
Prashant Cholachagudda

Reputation: 13092

You can find instructions/tutorial to interact with webview controls http://blog.zuehlke.com/en/mobile-ui-testing/

Upvotes: 1

Related Questions