How to save the the exact class and method name on screenshot in selenium?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to save the the exact class and method name on screenshot in selenium?

javelearner
Dear Selenium and Java user, 

I am interested to save the class and method name in which I have written the code(screenshot code), Is there any way to save the class and method name in such way that even through in future; class and method name is changed, i will pick the new name automatically? 

I know we can write manually String methodName = "mentionTheMethodNameHere"  but we have to change it each time manually, is there any way to make it automatic i.e whenever the user change the method name it can pick the latest method name?? 
Thanks, 
Java lover.. 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/77d75a9c-5c15-4478-b354-2c5f71c8151a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to save the the exact class and method name on screenshot in selenium?

javelearner
Hello users, I have found the way withIn the Main method HalfEbayTest obj = new HalfEbayTest(); String a = obj.getClass().getTypeName();  System.out.println(a);   

It give us the class name, is there anyway to do this without the main method or without creating the object.. ??

Thanks, 
Java Lover 

On Sunday, May 13, 2018 at 2:00:24 PM UTC-5, [hidden email] wrote:
Dear Selenium and Java user, 

I am interested to save the class and method name in which I have written the code(screenshot code), Is there any way to save the class and method name in such way that even through in future; class and method name is changed, i will pick the new name automatically? 

I know we can write manually String methodName = "mentionTheMethodNameHere"  but we have to change it each time manually, is there any way to make it automatic i.e whenever the user change the method name it can pick the latest method name?? 
Thanks, 
Java lover.. 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7462f3d8-b515-4395-a2fd-dd5f8b3d2ccf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to save the the exact class and method name on screenshot in selenium?

Reed Xia
For your reference, I have done some code for adding screenshot in selenium to Jenkins as JUnit attachment, see https://gist.github.com/python012/d962d797fa57a3e893d5be14b87de1b9.

Hop it helps.

On Mon, May 14, 2018 at 4:52 AM, <[hidden email]> wrote:
Hello users, I have found the way withIn the Main method HalfEbayTest obj = new HalfEbayTest(); String a = obj.getClass().getTypeName();  System.out.println(a);   

It give us the class name, is there anyway to do this without the main method or without creating the object.. ??

Thanks, 
Java Lover 

On Sunday, May 13, 2018 at 2:00:24 PM UTC-5, [hidden email] wrote:
Dear Selenium and Java user, 

I am interested to save the class and method name in which I have written the code(screenshot code), Is there any way to save the class and method name in such way that even through in future; class and method name is changed, i will pick the new name automatically? 

I know we can write manually String methodName = "mentionTheMethodNameHere"  but we have to change it each time manually, is there any way to make it automatic i.e whenever the user change the method name it can pick the latest method name?? 
Thanks, 
Java lover.. 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7462f3d8-b515-4395-a2fd-dd5f8b3d2ccf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAB_-H0_6ZyQx1d9DJDYK4uZKdBR%2BPZ3JBvvdyg-TVOLHy%2B2MvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.