Module 18 - Test Login Functionality | Selenium Forum
M
Posted on 05/08/2016
Hi i am stuck in to test is user is login or not as per show in Video. But i am using a different Website. so In this website:-
* First i registered successfully a user on Website with mandatory fields like First Name,Last Name,Email etc.
* I want to verify that a user is successfully login or not as per show in video. But problem is that in video you verify the user is login or not with his email id after successfully login.
* But in my site when i am successfully login, application display user name [b:3caqoadl]i.e[First Name + Last Name = SumitBhasin][/b:3caqoadl] in place of user email id. so i am not able to check that username is display on the top is equal to the name which is pass into the [b:3caqoadl]do login()[/b:3caqoadl] function.
So please suggest me how can i handle this scenario.

[b:3caqoadl]Project Attached:- [/b:3caqoadl]
Please refer [b:3caqoadl]TESTLOGIN.java[/b:3caqoadl] class under [b:3caqoadl]suite1 Package[/b:3caqoadl] and [b:3caqoadl]TestLogin.java[/b:3caqoadl] class under "[b:3caqoadl]Util" package[/b:3caqoadl].


[b:3caqoadl]WEBSITE URL:-
[u:3caqoadl]http://automationpractice.com[/u:3caqoadl]
UserName :- sam_bhasin4@yahoo.com
Pwd:- 310489[/b:3caqoadl]

M
Replied on 05/08/2016

Any Update?


M
Replied on 06/08/2016

For succesfull login , u no need to verify using email id, You can verify using name also.

String actual= driver.findElement(By.xpath(span[text()='sumit bhasin']).getText();
if (actual.equals("sumit bhasin"))
isLoggenin=True;


M
Replied on 07/08/2016

Hi Thanks for your suggestion.


M
Replied on 08/08/2016

is your code working now?