selenium - Validating The Login Credentials using Data Driven Frame Work -
Hello, I'm trying to validate credentials for many users using Selenium WebDriver as an example of Gmail Take it.
All user and password information is saved in the Excel file.
Issue:
Ask for user 1 - I am entering a valid username and valid password then the Gmail home page is displayed (able to login and logout) - The exam is near.
For user 2-I have entered the wrong identity in the excel file, but in the case of this error I am getting the error. Unable to detect element.
Because the user was not logged in and the code is pointing to the element that will only appear after the user's login.
For now, I tried to check the element with the "erro_msg" class, which if IF user enters the wrong identification, IF is visible.
I tried to check whether the element is invisible, continue logging and if it shows "Invalid Credential Message", check it
"Now the code is valid credentials Works fine for and logs out and this execution message for invalid credentials - closes the authentic authentication, now I'm getting the exception because the element in the above case is of incorrect credentials Training is visible, and the exception is to wait for the missing element "what do I need to ask a quick way to implement it? So, in the Excel file, if there are some incorrect credentials, I do not want to stop code execution, but want to capture invalid credentials and continue to try other users.
There are two ways to resolve this. Remember that after logging in, the page will usually be reloaded and you will either be back on the login screen or the default screen. This means that you ...
-
Look at the URL instead of searching for an element. You can either emphasize url.contains ("Looking for page names"); Or if you do not want to stop the trial due to unsuccessful effect, then log in it somewhere.
-
Create an extension method that allows you to an .xists () to separate an element (different than displayed). To do this, you will not get an exception to catching the element and something else will return like a tap. Then running Element () Truth will come back if the element is not empty. Wrong otherwise
Comments
Post a Comment