[JBoss JIRA] (ARQGRA-279) Support for method Graphene.element(WebElement, By) and its condition isPresent
by Jan Papousek (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-279?page=com.atlassian.jira.plugin... ]
Jan Papousek edited comment on ARQGRA-279 at 4/30/13 9:46 AM:
--------------------------------------------------------------
Thank you for the feature request! However I think it will be resolved by ARQGRA-273, then you will be able to write:
{code}
...
public void openFile(String path) {
String[] parts = path.split("/");
for (String part: parts) {
By by = jquerySelector(format("a.gwt-Anchor:contains('%s')", part));
waitAjax().until().element(by).is().present(); // HERE
Element partElement = root.findElement(by);
partElement.click();
}
}
...
{code}
Unfortunately it isn't possible before resolving ARQGRA-273, because the element returned by 'root.findElement(by)' is not proxy and the condition doesn't work for non-proxy elements.
was (Author: jpapouse):
Thank you for the feature request! However I think it will be resolved by ARQGRA-273, then you will be able to write:
{code}
...
public void openFile(String path) {
String[] parts = path.split("/");
for (String part: parts) {
By by = jquerySelector(format("a.gwt-Anchor:contains('%s')", part));
Element partElement = root.findElement(by);
waitAjax().until().element(partElement).is().present(); // HERE
partElement.click();
}
}
...
{code}
Unfortunately it isn't possible before resolving ARQGRA-273, because the element returned by 'root.findElement(by)' is not proxy and the condition doesn't work for non-proxy elements.
> Support for method Graphene.element(WebElement, By) and its condition isPresent
> -------------------------------------------------------------------------------
>
> Key: ARQGRA-279
> URL: https://issues.jboss.org/browse/ARQGRA-279
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Components: api
> Reporter: Sona Jamborova
>
> Please, can you add support for method Graphene.element(WebElement, By) for searching element (located by By) in parent element.
> Motivation:
> A panel which display content of current directory. Operations with this panel are open a file, open a child directory, go back. The content of this panel depends on file system and we use different file system for our test. I need create general framework for our tests. I think about:
> {code}
> public class Designer {
> ...
> @FindBy(jquery = "div.tabbable:contains('Project Explorer')")
> private ProjectExplorer projExpl;
> ...
> }
> {code}
> {code}
> public class ProjectExplorer {
> ...
> @Root
> private WebElement root;
>
> @FindBy(css = "table>tr:first-child() div");
> private WebElement path;
> ...
>
> public void openFile(String path) {
> String[] parts = path.split("/");
> for (String part: parts) {
> By by = jquerySelector(format("a.gwt-Anchor:contains('%s')", part));
> waitAjax().until(element(root, by).isPresent());
> root.findElement(by).click(); //this should be reduce to waitAjax().until(element(root, by).isPresent()).click(); (this is not point of this issue)
> }
> }
> public String getPath () {
> return path.getText();
> }
> }
> {code}
--
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
11 years, 8 months
[JBoss JIRA] (ARQGRA-297) Unable to access to WebElement after HTTP request
by Jan Papousek (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-297?page=com.atlassian.jira.plugin... ]
Jan Papousek resolved ARQGRA-297.
---------------------------------
Resolution: Won't Fix
I've reproduced the issue, but I think the problem is in your tests.
The application performs HTTP request after login, but that doesn't mean the next page is fully loaded. The application also performs XHR request and there is a huge amount of javascript code before the next page is shown. The presented stack trace just means the requested element (Sign Out) is not available, which can be true at that moment.
I suggest to change your code to:
{code:title=LoginDialog.java}
public class LoginDialog {
@FindBy(css="input[value*='Sign In']")
private WebElement signin;
@FindBy(css="input[name*='j_username']")
private WebElement user;
@FindBy(css="input[name*='j_password']")
private WebElement pasw;
public void login(String username, String password) {
user.click();
user.clear();
user.sendKeys(username);
pasw.click();
pasw.clear();
pasw.sendKeys(password);
signin.click();
}
}
{code}
{code:title=Uberfire.java}
public static class Uberfire {
@FindBy(css="div#login-content")
private LoginDialog login;
@FindBy(jquery="div.navbar a:contains('Logout')")
private WebElement signout;
public void login(String username) {
login.login(username, "admin");
Graphene.waitModel().until().element(signout).is().present();
}
}
{code}
The whole code I used to issue reproduction is available on https://github.com/papousek/graphene-wedriver-issues/tree/ARQGRA-297
> Unable to access to WebElement after HTTP request
> -------------------------------------------------
>
> Key: ARQGRA-297
> URL: https://issues.jboss.org/browse/ARQGRA-297
> Project: Arquillian Graphene
> Issue Type: Bug
> Affects Versions: 2.0.0.Alpha4
> Environment: Fedora 16, Firefox/Chrome
> Reporter: Sona Jamborova
> Assignee: Jan Papousek
> Priority: Critical
> Fix For: 2.0.0.Alpha5
>
> Attachments: seq1.png, seq2.png, seq3.png
>
>
--
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
11 years, 8 months