[arquillian-issues] [JBoss JIRA] (ARQ-1340) Drone webdriver is not created during @BeforeClass
Alex Okrushko (JIRA)
jira-events at lists.jboss.org
Wed Mar 6 13:44:57 EST 2013
[ https://issues.jboss.org/browse/ARQ-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759157#comment-12759157 ]
Alex Okrushko commented on ARQ-1340:
------------------------------------
Bumping up the priority, since {{@Page}} objects are not initialized during {{@BeforeClass}} and, unlike Drone, I cannot just call {{.getProxy()}} for {{@Page}} objects.
Have to use the stupid workaround:
{code:java}
@Drone
private static WebDriver driver;
@Page
private static LoginPage loginPage;
private static Boolean beforeClass = true;
@Before
public void setup(){
System.out.println("BEFORE");
if (!beforeClass){
return;
}
beforeClass = false;
System.out.println("BREFORE CLASS");
driver.navigate().to(loginPage.URL);
}
{code}
> Drone webdriver is not created during @BeforeClass
> --------------------------------------------------
>
> Key: ARQ-1340
> URL: https://issues.jboss.org/browse/ARQ-1340
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Extension - Drone
> Affects Versions: 1.0.3.Final
> Environment: Arquillian JUnit Container 1.0.3.Final
> Arquillian Graphene Webdriver 2.0.0.Alpha3
> Arquillian Drone dependencies and Selenium dependencies 1.1.1.Final
> Arquillian Core dependencies 1.0.3.Final
> junit 4.8.1
> jdk 1.6
> Reporter: Alex Okrushko
> Assignee: Karel Piwko
> Fix For: 1.0.4.Final
>
>
> Drone webdriver is not created during @BeforeClass, however *is created during @Before or if called by GrapheneContext.getProxy()*
> The following does NOT work:
> {code:java}
> @RunWith(Arquillian.class)
> public class TestDroneLogin {
> @Drone
> private static WebDriver driver;
>
> @BeforeClass
> public static void setup(){
> //GrapheneContext.getProxy().navigate().to("http://google.com");
> driver.navigate().to("http://google.com");
> }
>
> @Test
> public void testInput(){
> driver.findElement(By.cssSelector("input#gbqfq"));
> }
> }
> {code}
> However, if I use {{GrapheneContext.getProxy()}} instead of {{driver}}, everything works as expected:
> {code:java}
> @BeforeClass
> public static void setup(){
> GrapheneContext.getProxy().navigate().to("http://google.com");
> }
> {code}
> ALSO, if {{@Before}} is used then Drone webdriver is created as expected, so this problem is specific to {{@BeforeClass}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the arquillian-issues
mailing list