Uploaded image for project: 'Arquillian Graphene'
  1. Arquillian Graphene
  2. ARQGRA-439

Infer WebDriver context for @FindBy injections when there is only one qualified browser

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.2.Final
    • Fix Version/s: 2.2-Tracking
    • Component/s: core, ftest
    • Labels:
      None

      Description

      When one is using qualified WebDriver instances, he needs to annotate also his WebElement, ... to distinguish in which context those elements should be resolved.

      This has to be done also when there is only one (though qualified) browser injected.

      Suppose:

      @RunWith(Arquillian.class)
      public class GrapheneBugDroneTest {
      
          @Drone
          @BugReport
          WebDriver driver;
      
          @Deployment(testable = false)
          public static Archive<?> deployHtml5DemoApp() {
              return Deployments.createDeployment();
          }
      
          @ArquillianResource
          URL url;
      
          @FindBy(id = "name")
          @BugReport
          WebElement nameField;
      
          @Test
          public void addUser() throws Exception {
              driver.get(url.toString());
              Graphene.waitGui(driver).until().element(nameField).is().present();
              Assert.assertTrue(true);
          }
      
          @Qualifier
          @Retention(RetentionPolicy.RUNTIME)
          public static @interface BugReport {
          }
      }
      

      Graphene can interfere which WebDriver instance was injected and act accordingly. The idea is also described here.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  jhuska Juraj Húska
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated: