Module18:Merging two class files | Selenium Forum
M
Posted on 15/11/2016
Created new class-"Login" and able to login with credentials supplied from excel
[attachment=1:1n25l9e5]Login.png[/attachment:1n25l9e5]

Created another class-"Register". In this, Admin can create new user only after login to application.
So, tried to call "Login" function in this. But how to supply username,password for login from excel?
[b:1n25l9e5][u:1n25l9e5]Reason:[/u:1n25l9e5][/b:1n25l9e5]
All values are supplied from "Excel" for "Register" class.
In this case, how is it possible to supply data for "Login" also from "Excel"

[attachment=0:1n25l9e5]Registeruser.png[/attachment:1n25l9e5]

M
Replied on 15/11/2016

what is the error? why is the red line there? hover the mouse over red line.


M
Replied on 16/11/2016

[quote="qtpselenium.supp0rt@gmail.com":1iv2zjgq]Post subject: Re: Module18:Merging two class files
what is the error? why is the red line there? hover the mouse over red line.
[/quote:1iv2zjgq]

String "Username" & "Password" are defined in "TestUtil" class (Login function)

At present we are in "Registeruser" class(Register user function) and trying to call "Login" function.

As "username" parameter doesnt exists in "Register user", red color is displayed


M
Replied on 16/11/2016

hover over red line and eclipse will show a popup. send a screen show of that.


M
Replied on 17/11/2016

[quote="qtpselenium.supp0rt@gmail.com":v0t70p4n]hover over red line and eclipse will show a popup. send a screen show of that.[/quote:v0t70p4n]

[attachment=0:v0t70p4n]Mod18-merging 2 class files.png[/attachment:v0t70p4n]

Responsive image

M
Replied on 18/11/2016

check if '[color=#FF0000:1b0betd2]username[/color:1b0betd2]' variable is created or not? i don't think username is created.


M
Replied on 18/11/2016

Iam trying to call "Login" function which is created in class"Test Util".
Username & password values are supplied to "Login" function from excel (Using Parameters--@Runwith(parameterized.class))
it is working fine, when "Login" function is executed.

Now another function "Register" is created in [b:155gxs1l][u:155gxs1l]different [/u:155gxs1l][/b:155gxs1l]class.
For registering user, it is mandatory to login to application.
so i tried to call "TestUtil.Login" but got this message.

please let me know if iam not clear so that i can reach you in skype


M
Replied on 21/11/2016

can you come now?


M
Replied on 21/11/2016

[quote="qtpselenium.supp0rt@gmail.com":d4v5hg4v]can you come now?[/quote:d4v5hg4v]

Iam available on skype now


M
Replied on 22/11/2016

are you available now?


M
Replied on 23/11/2016

Iam able to solve this
1) by merging both login & register into single class
2) all Input parameters are passed to this from same excel sheet

Is this correct way to fix this or any better solution to fix this?


[attachment=0:x1h57fnm]Mod18- 2 class files.png[/attachment:x1h57fnm]

Responsive image

M
Replied on 23/11/2016

yeah its the correct.