简体   繁体   中英

How to create Text file and write exceptions in it automatically using Selenium WebDriver C#

i am using selenium web-driver in c#, i want to Create a text/ log file and write exception in it automatically. right now i am doing testing on log in page. if i change the password then the exception should be written in text file with time stamp.

I would recommend using log4net ( http://logging.apache.org/log4net/ ) it's a pretty straight forward logging library. Selenium doesn't really have any impact on your logging. You handle exceptions the same and put logging statements in the catch's as you normally would.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM