C# Selenium - one ChromeDriver for multiple forms? -


i have few forms , i'd have them operating on 1 webdriver. somehow possible? tried creating driver in new class couldnt pass forms.

code in form:

selenium1 sel = new selenium1(); sel.create(); chromedriver driver = sel.get(); 

class code:

namespace vulcan2 {     public class selenium1     {         chromedriver driverx;         public void create()         {             chromedriver driverx = new chromedriver();         }         public chromedriver driver()         {             return driverx;         }     } } 

you can turn driver class static class:

static public class selenium1 {     static chromedriver driverx;      static public void create()     {         driverx = new chromedriver();     }      static public chromedriver driver()     {         return driverx;     } } 

and may call this:

selenium1.driver().close(); 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -