How to solve the problem of not founding a web page element? How is the dynamic object could be used?
Please provide more information about the problem. Read this for guidance:
Thank you for your help,
I am testing a web application (developed using JSF Technology), and the problem occurred on the login page. the test run while inserting username and password but after clicking the sign in button this error has appeared;
I used delay actions, wait for page load, wait for element present, but this didnât work with this case.
this is the error message from the Consol:
Test Cases/Valid Login FAILED because (of) Unable to verify object âObject Repository/Page_My Dashboard/span_ui-buttonâ is visible (Root cause: Web element with id: âObject Repository/Page_My Dashboard/span_ui-buttonâ located by âBy.xpath: id(âj_idt95:patient_list_btnâ)/span[@class=âui-button-text ui-câ]â not found)
Test Cases/Valid Login.run:38
this the HTML tag for the button sign In and the other element that should be found in the next page (which is the main page) so I verify that this element is present to ensure that application move to the next page after login but in the chrome window the application stays on the login page.
username text feild HTML code
sign In Button HTML code
Sign In
the element on the next page of login is
DASHBOARD
For more details :
Sorry for missing that, the previous error message that I put in the previous comment is for verifying another element in the same page which is:
This is the error message for the dashboard element that I put the HTML code for it,
Test Cases/Valid Login FAILED because (of) Unable to verify object âObject Repository/Page_EMERGENCY-Form Template Setup/span_DASHBOARDâ is visible (Root cause: Web element with id: âObject Repository/Page_EMERGENCY-Form Template Setup/span_DASHBOARDâ located by âBy.xpath: id(âmenuform:j_idt45â)/a[1]/span[1]â not found)
Test Cases/Valid Login.run:38
Hello all,
this is the screenshot for the test script
and also the selection methods of my objects, I select the XPath method here,
This is very confusing to follow.
Iâm assuming there is ONE line that is failing, which is the line before closeBrowser, that says verifyElementVisible. That line has the error:
Test Cases/Valid Login FAILED because (of) Unable to verify object
âObject Repository/Page_EMERGENCY-Form Template Setup/span_DASHBOARDâ is
visibleâŚ
Youâve shown that element has the following xpath:
But the error message goes on to say a DIFFERENT xpath:
(Root cause: Web element with id: âObject Repository/Page_EMERGENCY-Form
Template Setup/span_DASHBOARDâ located by âBy.xpath:
id(âmenuform:j_idt45â)/a[1]/span[1]â not found)
Iâm sorry, but this is meant to be engineering, but with a jumble of misquoted errors and ill-formatted posts, itâs impossible to fathom whatâs really going on and perform any kind of analysis.
I advise you edit your posts and fix them, or, abandon this thread and post again with a more succinct error report and any relevant supporting information (HTML, xpaths, etc).
Hello All
Thank you Russ Thomas for your notes and help. Iâm sorry that my posts are not clear but I will fix them here step by step.
First: the final screenshot is the wrong one, it is for the dashboard link, so this the right one for the dashboard span is that
this is the screenshot for the test script
this is for sign in button object and the selection method of my objects, I select the XPath method here,
The Third point is: the application stays at the login screen which seems that doesnât move to the next page to see the object that is needed to be verified.
login page of the application
Is there a reason why are you using WebUI.clickOffset() with (0,0) coordinates?
I would first get sure your âSign inâ button gets clicked. Try using the regular WebUI.click() on the button and then something like WebUI.waitForElementNotVisible() to make sure you are no longer on the login screen.
After executing the test script the chrome stops at the login screen as I said before.
I need to add a note that I have used clickOffset action for the login button instead of click because click didnât work with me.
The HTML code for the login Button is:
<button id="login:j_idt15" name="login:j_idt15" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left raised-btn rounded-btn" onclick="PrimeFaces.bcn(this,event,[function(event){showLoading()},function(event){PrimeFaces.onPost();}]);" type="submit" role="button" aria-disabled="false"><span class="ui-button-icon-left ui-icon ui-c fa fa-user"></span><span class="ui-button-text ui-c">Sign In</span></button>
The HTML Code for dashboard span is :
<span>DASHBOARD</span>
The error message in the log viewer after the test case failed is
Test Cases/Valid Login FAILED because (of) Unable to verify object âObject Repository/Page_EMERGENCY-Form Template Setup/span_DASHBOARDâ is visible (Root cause: Web element with id: âObject Repository/Page_EMERGENCY-Form Template Setup/span_DASHBOARDâ located by âBy.xpath: id(âmenuform:j_idt45â)/a[1]/span[1]â not found)
Test Cases/Valid Login.run:38
maha,
I donât have the time to backtrack in this thread hoping I donât
accidentally read âthe wrong postâ and further confuse the issue.
My advice is as I stated earlier:
Iâm sorry, but this is meant to be engineering, but with a
jumble of misquoted errors and ill-formatted posts, itâs impossible to
fathom whatâs really going on and perform any kind of analysis.I advise you edit your posts and fix them, or, abandon this thread and post again with a more succinct error report and any relevant supporting information (HTML, xpaths, etc).
Let me say it more forcefully: If I had the powers to do so, I would close this thread.
This is NOT personal. Itâs merely a matter of efficacy. This thread is too costly (time-wise).
Sorry.