How to use NewMap method of session Package

Best Selenoid code snippet using session.NewMap

server.go

Source:server.go Github

copy

Full Screen

1package main2import (3 "database/sql"4 "github.com/codegangsta/martini"5 "github.com/codegangsta/martini-contrib/binding"6 "github.com/codegangsta/martini-contrib/render"7 "github.com/codegangsta/martini-contrib/sessions"8 "github.com/coopernurse/gorp"9 _ "github.com/go-sql-driver/mysql"10 "github.com/codegangsta/martini-contrib/sessionauth"11 "log"12 "net/http"13 "time"14 "html/template"15 "strconv"16 "regexp"17 "strings"18)19type Post struct {20 // db tag lets you specify the column name if it differs from the struct field21 Id int64 `db:"post_id"`22 Created int6423 Title string `form:"Title" binding:"required"`24 Body string `form:"Body"`25 UserId int64 `form:"UserId"`26 Url string27}28type User struct {29 Id int64 `form:"id" db:"id"`30 Email string `form:"email" db:"email" binding:"required"`31 Password string `form:"password" db:"password" binding:"required"`32 Name string `form:"name" db:"name"`33 authenticated bool `form:"-" db:"-"`34}35func newUser(email string, password string, name string, authenticated bool) User {36 return User{37 Email: email,38 Password: password,39 Name: name,40 authenticated: authenticated, 41 }42}43func newPost(title string, body string, user int64) Post {44 //let's make pretty urls from title45 reg, err := regexp.Compile("[^A-Za-z0-9]+")46 if err != nil {47 log.Fatal(err)48 }49 prettyurl := reg.ReplaceAllString(title, "-")50 prettyurl = strings.ToLower(strings.Trim(prettyurl, "-"))51 return Post{52 Created: time.Now().Unix(),53 Title: title,54 Body: body,55 UserId: user,56 Url: prettyurl,57 }58}59func checkErr(err error, msg string) {60 if err != nil {61 log.Fatalln(msg, err)62 }63}64//BINDING: https://github.com/codegangsta/martini-contrib/tree/master/binding65//sample custom Post struct validation66func (bp Post) Validate(errors *binding.Errors, req *http.Request) {67 //custom validation68 if len(bp.Title) == 0 {69 errors.Fields["title"] = "Title cannot be empty"70 }71}72//sample custom User struct validation73func (bp User) Validate(errors *binding.Errors, req *http.Request) {74 //custom validation75}76//SESSIONAUTH: https://github.com/codegangsta/martini-contrib/tree/master/sessionauth77// GetAnonymousUser should generate an anonymous user model for all sessions. This should be an unauthenticated 0 value struct.78func GenerateAnonymousUser() sessionauth.User {79 return &User{}80}81// Login will preform any actions that are required to make a user model officially authenticated.82func (u *User) Login() {83 // Update last login time, add to logged-in user's list84 u.authenticated = true85}86// Logout will preform any actions that are required to completely logout a user.87func (u *User) Logout() {88 // Remove from logged-in user's list89 u.authenticated = false90}91func (u *User) IsAuthenticated() bool {92 return u.authenticated93}94func (u *User) UniqueId() interface{} {95 return u.Id96}97// GetById will populate a user object from a database model with a matching id.98func (u *User) GetById(id interface{}) error {99 err := dbmap.SelectOne(u, "SELECT * FROM users WHERE id = ?", id)100 if err != nil {101 return err102 }103 return nil104}105//INITAL DATABASE SETUP106var dbmap *gorp.DbMap107func initDb() *gorp.DbMap {108 db, err := sql.Open("mysql", "USERNAME:PASSWORD@unix(/var/run/mysqld/mysqld.sock)/webapp")109 checkErr(err, "sql.Open failed")110 dbmap := &gorp.DbMap{Db: db, Dialect: gorp.MySQLDialect{"InnoDB", "UTF8"}}111 dbmap.AddTableWithName(User{}, "users").SetKeys(true, "Id")112 err = dbmap.CreateTablesIfNotExists()113 checkErr(err, "Create tables failed")114 dbmap.AddTableWithName(Post{}, "posts").SetKeys(true, "Id")115 err = dbmap.CreateTablesIfNotExists()116 checkErr(err, "Create tables failed")117 return dbmap118}119func main() {120 //Change secret123 to something more secure and store session in backend instead of cookie121 store := sessions.NewCookieStore([]byte("secret123"))122 dbmap = initDb()123 124 defer dbmap.Db.Close()125 err := dbmap.TruncateTables()126 checkErr(err, "TruncateTables failed")127 u1 := newUser("bob@domain.com", "pass", "Bob", false)128 //insert rows129 err = dbmap.Insert(&u1)130 checkErr(err, "Insert failed")131 //create two posts, assign to user 1 above132 p1 := newPost("Post 1", "Lorem ipsum lorem ipsum",1)133 p2 := newPost("Post 2", "This is my second post",1)134 // insert rows135 err = dbmap.Insert(&p1, &p2)136 checkErr(err, "Insert failed")137 138 m := martini.Classic()139 m.Use(render.Renderer(render.Options{140 Directory: "templates",141 Layout: "layout",142 Funcs: []template.FuncMap{143 {144 "formatTime": func(args ...interface{}) string { 145 t1 := time.Unix(args[0].(int64), 0)146 return t1.Format(time.Stamp)147 },148 },149 },150 }))151 m.Use(sessions.Sessions("my_session", store))152 m.Use(sessionauth.SessionUser(GenerateAnonymousUser))153 sessionauth.RedirectUrl = "/login"154 sessionauth.RedirectParam = "next"155 //ROUTES156 m.Get("/register", func(r render.Render, user sessionauth.User) {157 //redirect to homepage if already authenticated158 if(user.IsAuthenticated()){159 r.Redirect("/")160 } else {161 r.HTML(200, "register", nil)162 }163 164 })165 m.Get("/login", func(r render.Render, user sessionauth.User) {166 //redirect to homepage if already authenticated167 if(user.IsAuthenticated()){168 r.Redirect("/")169 } else {170 r.HTML(200, "login", nil)171 }172 })173 m.Post("/login", binding.Form(User{}), func(session sessions.Session, postedUser User, r render.Render, ferr binding.Errors, req *http.Request) {174 log.Println(ferr)175 //Example of server side error validation for the client side form176 if ferr.Count() > 0 {177 newmap := map[string]interface{}{"metatitle":"Registration", "errormessage":"Error with Form Submission"}178 r.HTML(200, "login", newmap)179 } else {180 user := User{}181 182 //check login credentails with DataBase183 err := dbmap.SelectOne(&user, "SELECT * FROM users WHERE email = ? and password = ?", postedUser.Email, postedUser.Password)184 if err != nil {185 r.Redirect(sessionauth.RedirectUrl)186 return187 } else {188 err := sessionauth.AuthenticateSession(session, &user)189 if err != nil {190 r.JSON(500, err)191 }192 params := req.URL.Query()193 redirect := params.Get(sessionauth.RedirectParam)194 r.Redirect(redirect)195 return196 }197 }198 })199 m.Get("/logout", sessionauth.LoginRequired, func(session sessions.Session, user sessionauth.User, r render.Render) {200 sessionauth.Logout(session, user)201 r.Redirect("/")202 })203 m.Get("/", func(r render.Render, authuser sessionauth.User) {204 var posts []Post205 _, err = dbmap.Select(&posts, "select * from posts order by post_id")206 checkErr(err, "Select failed")207 newmap := map[string]interface{}{"metatitle": "HomePage", "authuser": authuser, "posts": posts}208 r.HTML(200, "posts", newmap)209 })210 m.Get("/users", func(r render.Render, authuser sessionauth.User) {211 var users []User212 213 _, err = dbmap.Select(&users, "select * from users order by id")214 checkErr(err, "Select failed")215 216 newmap := map[string]interface{}{"metatitle": "Users listing", "authuser": authuser, "users": users}217 r.HTML(200, "users", newmap)218 })219 m.Get("/users/:id", sessionauth.LoginRequired, func(args martini.Params, r render.Render, authuser sessionauth.User) {220 221 var user User222 223 err = dbmap.SelectOne(&user, "select * from users where id=?", args["id"])224 225 //simple error check226 if err != nil {227 newmap := map[string]interface{}{"metatitle":"404 Error", "message":"User not found"}228 r.HTML(404, "error", newmap)229 } else {230 var posts []Post231 _, err = dbmap.Select(&posts, "select * from posts where UserId=?", args["id"])232 checkErr(err, "Select failed")233 234 newmap := map[string]interface{}{"metatitle": user.Name+" profile page", "authuser": authuser, "user": user, "posts": posts}235 r.HTML(200, "user", newmap)236 } 237 })238 m.Post("/users", binding.Form(User{}), func(session sessions.Session, user User, ferr binding.Errors, r render.Render) {239 //Example of server side error validation for the client side form240 if ferr.Count() > 0 {241 newmap := map[string]interface{}{"metatitle":"Registration", "errormessage":"Error with Form Submission"}242 r.HTML(200, "register", newmap)243 } else {244 u := newUser(user.Email, user.Password, user.Name, user.authenticated)245 246 err = dbmap.Insert(&u)247 checkErr(err, "Insert failed")248 //create the session and redirect always to homepage249 err := sessionauth.AuthenticateSession(session, &u)250 if err != nil {251 r.JSON(500, err)252 }253 r.Redirect("/")254 }255 })256 m.Put("/users/:id", binding.Bind(User{}), func(args martini.Params, user User, r render.Render, authuser sessionauth.User) {257 //convert string to int64 so you can match the struct (passing userid via ajax does not work as it comes in as a string)258 f, _ := strconv.ParseInt(args["id"],0,64)259 //only allow the authenticated user to update his user attributes260 if(authuser.UniqueId() == f){261 262 //specify the user id263 user.Id = f264 count, err := dbmap.Update(&user)265 checkErr(err, "Update failed")266 log.Println("Rows updated:", count)267 if count == 1 {268 newmap := map[string]interface{}{"responseText":"success"} 269 r.JSON(200, newmap)270 } else {271 newmap := map[string]interface{}{"responseText":"error"}272 r.JSON(400, newmap)273 } 274 275 } else {276 newmap := map[string]interface{}{"responseText":"You are not allowed to update this resource."}277 r.JSON(403, newmap) 278 }279 })280 m.Delete("/users/:id", func(args martini.Params, r render.Render, authuser sessionauth.User) {281 282 //convert id from string to int64283 f, _ := strconv.ParseInt(args["id"],0,64)284 //only allow the authenticated user to delete him or her285 if(authuser.UniqueId() == f){286 _, err = dbmap.Exec("delete from users where id=?", args["id"])287 checkErr(err, "Delete failed")288 if err == nil {289 newmap := map[string]interface{}{"responseText":"success"} 290 r.JSON(200, newmap)291 //if you delete yourself, Ajax should redirec you292 } else {293 newmap := map[string]interface{}{"responseText":"error"}294 r.JSON(400, newmap)295 } 296 } else {297 newmap := map[string]interface{}{"responseText":"You are not allowed to delete this resource."}298 r.JSON(403, newmap) 299 }300 })301 m.Post("/posts", sessionauth.LoginRequired, binding.Bind(Post{}), func(post Post, r render.Render, authuser sessionauth.User) {302 //convert to int64303 f := authuser.UniqueId().(int64)304 p1 := newPost(post.Title, post.Body,f)305 err = dbmap.Insert(&p1)306 checkErr(err, "Insert failed")307 r.Redirect("/")308 })309 m.Get("/posts/:id", func(args martini.Params, r render.Render, authuser sessionauth.User) {310 var post Post311 err = dbmap.SelectOne(&post, "select * from posts where post_id=?", args["id"])312 313 //simple error check314 if err != nil {315 newmap := map[string]interface{}{"metatitle":"404 Error", "message":"This is not found"}316 r.HTML(404, "error", newmap)317 } else {318 newmap := map[string]interface{}{"metatitle": post.Title+" more custom","authuser": authuser, "post": post}319 r.HTML(200, "post", newmap)320 }321 })322 m.Get("/p/:str", func(args martini.Params, r render.Render, authuser sessionauth.User) {323 var post Post324 err = dbmap.SelectOne(&post, "select * from posts where url=?", args["str"])325 326 //simple error check327 if err != nil {328 newmap := map[string]interface{}{"metatitle":"404 Error", "message":"This is not found"}329 r.HTML(404, "error", newmap)330 } else {331 newmap := map[string]interface{}{"metatitle": post.Title+" more custom","authuser": authuser, "post": post}332 r.HTML(200, "post", newmap)333 }334 })335 m.Put("/posts/:id", binding.Bind(Post{}), func(args martini.Params, post Post, r render.Render, authuser sessionauth.User) {336 var newTitle = post.Title337 var newBody = post.Body338 err = dbmap.SelectOne(&post, "select * from posts where post_id=?", args["id"])339 //simple database error check340 if err != nil {341 newmap := map[string]interface{}{"message":"Something went wrong."}342 r.JSON(400, newmap)343 } else {344 //owner check345 if(authuser.UniqueId() == post.UserId){346 post.Title=newTitle347 post.Body=newBody348 count, err := dbmap.Update(&post)349 checkErr(err, "Update failed")350 351 if count == 1 {352 newmap := map[string]interface{}{"responseText":"success"}353 r.JSON(200, newmap)354 } else {355 newmap := map[string]interface{}{"responseText":"error"}356 r.JSON(400, newmap)357 } 358 } else {359 newmap := map[string]interface{}{"responseText":"You are not allowed to modify this resource."}360 r.JSON(403, newmap)361 }362 } 363 364 })365 m.Delete("/posts/:id", func(args martini.Params, r render.Render, authuser sessionauth.User) {366 //retrieve the post to check the real owner367 var post Post368 err = dbmap.SelectOne(&post, "select * from posts where post_id=?", args["id"])369 //simple DB error check370 if err != nil {371 newmap := map[string]interface{}{"message":"Something went wrong."}372 r.JSON(400, newmap)373 } else {374 //owner check375 if(authuser.UniqueId() == post.UserId){376 //delete it377 _, err := dbmap.Delete(&post)378 checkErr(err, "Delete failed")379 newmap := map[string]interface{}{"responseText":"success"}380 r.JSON(200, newmap)381 } else {382 newmap := map[string]interface{}{"responseText":"You are not allowed to delete this resource."}383 r.JSON(403, newmap) 384 }385 }386 })387 m.Run()388}...

Full Screen

Full Screen

controller_test.go

Source:controller_test.go Github

copy

Full Screen

1package controller2import (3 "bytes"4 "encoding/json"5 "fmt"6 "io"7 "io/ioutil"8 "net/http"9 "net/http/httptest"10 "net/url"11 "strings"12 "testing"13 "text/template"14 "github.com/ksw95/GoIndustrialProject/Client/session"15 "github.com/labstack/echo"16 "github.com/stretchr/testify/assert"17)18var (19 // GetDoFunc fetches the mock client's `Do` func20 Client HTTPClient21)22func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error {23 return t.templates.ExecuteTemplate(w, name, data)24}25type (26 // Custom type that allows setting the func that our Mock Do func will run instead27 MockDoFunc func(req *http.Request) (*http.Response, error)28 // MockClient is the mock client29 MockClient struct {30 MockDo MockDoFunc31 }32 Template struct {33 templates *template.Template34 }35 HTTPClient interface {36 Do(req *http.Request) (*http.Response, error)37 }38)39// Overriding what the Do function should "do" in our MockClient40func (m *MockClient) Do(req *http.Request) (*http.Response, error) {41 return m.MockDo(req)42}43// provides the wrapper required by handlers44func getDependency(address string, encode io.Reader) (*session.Session, *httptest.ResponseRecorder, *http.Request, *session.SessionStruct, *echo.Echo, echo.Context) {45 mapSession := make(map[string]*session.SessionStruct)46 sessionMgr := &session.Session{47 MapSession: &mapSession,48 ApiKey: "key",49 Client: &http.Client{},50 }51 //mock form values to function post52 rec := httptest.NewRecorder()53 req := httptest.NewRequest(http.MethodPost, address, encode)54 req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationForm)55 e := echo.New()56 c := e.NewContext(req, rec)57 sessionStruct, uuid := sessionMgr.NewEmptySession(c)58 req.AddCookie(&http.Cookie{59 Name: "foodiepandaCookie",60 Value: uuid,61 MaxAge: 300,62 })63 c = e.NewContext(req, rec)64 tem := &Template{65 templates: template.Must(template.ParseGlob("templates/*.gohtml")),66 }67 e.Renderer = tem68 return sessionMgr, rec, req, sessionStruct, e, c69}70func TestIndex_GET(t *testing.T) {71 client := &MockClient{72 MockDo: func(req *http.Request) (*http.Response, error) {73 return &http.Response{74 StatusCode: 202,75 }, nil76 },77 }78 // get dependencies79 sessionMgr, rec, _, _, _, c := getDependency("/", nil)80 sessionMgr.Client = client81 // fmt.Println(rec.Body)82 if assert.NoError(t, Index_GET(c, sessionMgr)) {83 assert.Equal(t, http.StatusOK, rec.Code)84 }85}86func TestIndex_POST(t *testing.T) {87 client := &MockClient{88 MockDo: func(req *http.Request) (*http.Response, error) {89 return &http.Response{90 StatusCode: 202,91 }, nil92 },93 }94 //insert form value95 f := make(url.Values)96 f.Set("cat", "Food")97 f.Set("query", "item")98 // get dependencies99 sessionMgr, rec, _, _, _, c := getDependency("/", strings.NewReader(f.Encode()))100 sessionMgr.Client = client101 // fmt.Println(rec.Body)102 if assert.NoError(t, Index_POST(c, sessionMgr)) {103 assert.Equal(t, http.StatusSeeOther, rec.Code)104 fmt.Println(c.Request().URL)105 }106}107func TestSearchPage_GET_Food(t *testing.T) {108 // create dependencies109 // mock client Do for handler110 // build our response JSON111 // create a new reader with that JSON112 client := &MockClient{113 MockDo: func(req *http.Request) (*http.Response, error) {114 querySearch := req.URL.Query().Get("search")115 queryType := req.URL.Query().Get("type")116 assert.Equal(t, "item", querySearch)117 assert.Equal(t, "Food", queryType)118 dataResponse := []interface{}{getDummyData("Food", 1),119 getDummyData("Food", 2),120 getDummyData("Food", 3),121 }122 searchResult := struct {123 Msg string124 ResBool string125 Data []interface{}126 }{127 "ok",128 "true",129 dataResponse,130 }131 jsonResponse, _ := json.Marshal(searchResult)132 r := ioutil.NopCloser(bytes.NewReader([]byte(jsonResponse)))133 return &http.Response{134 StatusCode: 202,135 Body: r,136 }, nil137 },138 }139 //insert form value140 q := make(url.Values)141 q.Set("cat", "Food")142 q.Set("query", "item")143 sessionMgr, rec, _, _, _, c := getDependency("/search?"+q.Encode(), nil)144 sessionMgr.Client = client145 // fmt.Println(rec.Body)146 if assert.NoError(t, SearchPage_GET(c, sessionMgr)) {147 assert.Equal(t, http.StatusOK, rec.Code)148 fmt.Println(c.Request().URL)149 }150}151func TestSearchPage_GET_Restaurant(t *testing.T) {152 // create dependencies153 // mock client Do for handler154 // build our response JSON155 // create a new reader with that JSON156 client := &MockClient{157 MockDo: func(req *http.Request) (*http.Response, error) {158 querySearch := req.URL.Query().Get("search")159 queryType := req.URL.Query().Get("type")160 assert.Equal(t, "item", querySearch)161 assert.Equal(t, "Restaurant", queryType)162 dataResponse := []interface{}{getDummyData("Restaurant", 1),163 getDummyData("Restaurant", 2),164 getDummyData("Restaurant", 3),165 }166 searchResult := struct {167 Msg string168 ResBool string169 Data []interface{}170 }{171 "ok",172 "true",173 dataResponse,174 }175 jsonResponse, _ := json.Marshal(searchResult)176 r := ioutil.NopCloser(bytes.NewReader([]byte(jsonResponse)))177 return &http.Response{178 StatusCode: 202,179 Body: r,180 }, nil181 },182 }183 //insert form value184 q := make(url.Values)185 q.Set("cat", "Restaurant")186 q.Set("query", "item")187 sessionMgr, rec, _, _, _, c := getDependency("/search?"+q.Encode(), nil)188 sessionMgr.Client = client189 // fmt.Println(rec.Body)190 if assert.NoError(t, SearchPage_GET(c, sessionMgr)) {191 assert.Equal(t, http.StatusOK, rec.Code)192 fmt.Println(c.Request().URL)193 }194}195func getDummyData(db string, id int) (newMap map[string]interface{}) {196 newMap = make(map[string]interface{})197 switch db {198 case "UserCond":199 newMap["Username"] = id200 newMap["LastLogin"] = "20-7-2021"201 newMap["MaxCalories"] = 2500202 newMap["Diabetic"] = "Not Diabetic"203 newMap["Halal"] = "Not Halal"204 newMap["Vegan"] = "Not Vegan"205 case "Food":206 newMap["ID"] = id207 newMap["Name"] = "Name"208 newMap["ShopID"] = 1209 newMap["Calories"] = 800210 newMap["Description"] = "Description"211 newMap["Sugary"] = "Not Sugary"212 newMap["Halal"] = "Not Halal"213 newMap["Vegan"] = "Not Vegan"214 case "History":215 newMap["ID"] = id216 newMap["Username"] = "username"217 newMap["FoodPurchase"] = "20-7-2021"218 newMap["Price"] = 3.7219 newMap["DeliveryMode"] = "Walking"220 newMap["Distance"] = 2.2221 newMap["CaloriesBurned"] = 120222 case "Account":223 newMap["Username"] = "Username"224 newMap["Password"] = "Password"225 }226 return227}...

Full Screen

Full Screen

module.go

Source:module.go Github

copy

Full Screen

...63 //初始化地图和协程,每张地图一个协程64 loadedMapCount = 065 for i := range conf.Server.MapLoad {66 mapId := conf.Server.MapLoad[i]67 newMap := NewMap(mapId)68 m.wgMap.Add(1)69 Maps[mapId] = newMap70 go func() {71 log.Debug("map %v goroutine start", mapId)72 newMap.Run(newMap.closeSig)73 log.Debug("map %v goroutine exit", mapId)74 m.wgMap.Done()75 }()76 newMap.ChanRPCServer.Go("LoadMap", newMap)77 }78 //开启计时器79 m.secondTicker = shared.NewUserTicker(time.Second, func() {80 for _, m := range Maps {81 m.ChanRPCServer.Go("OnTimerSecond", m)...

Full Screen

Full Screen

NewMap

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 err := shim.Start(new(Chaincode))4 if err != nil {5 fmt.Println("Could not start chaincode")6 fmt.Println(err)7 }8}9type Chaincode struct {10}11func (t *Chaincode) Init(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {12 _, err = stub.NewMap("Map1")13 if err != nil {14 }15}16func (t *Chaincode) Query(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {17}18func (t *Chaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {19}20import (21func main() {22 err := shim.Start(new(Chaincode))23 if err != nil {24 fmt.Println("Could not start chaincode")25 fmt.Println(err)26 }27}28type Chaincode struct {29}30func (t *Chaincode) Init(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {31 _, err = stub.NewMap("Map1")32 if err != nil {33 }34}35func (t *Chaincode) Query(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {36}37func (t *Chaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {38 map1, err = stub.GetMap("Map1")39 if err != nil {40 }41}

Full Screen

Full Screen

NewMap

Using AI Code Generation

copy

Full Screen

1session := NewSession()2session.NewMap("session_map")3session := NewSession()4session.GetMap("session_map")5session := NewSession()6session.NewMap("session_map")7session := NewSession()8session.GetMap("session_map")9session := NewSession()10session.NewMap("session_map")11session := NewSession()12session.GetMap("session_map")13session := NewSession()14session.NewMap("session_map")15session := NewSession()16session.GetMap("session_map")17session := NewSession()18session.NewMap("session_map")19session := NewSession()20session.GetMap("session_map")21session := NewSession()22session.NewMap("session_map")23session := NewSession()24session.GetMap("session_map")25session := NewSession()26session.NewMap("session_map")27session := NewSession()28session.GetMap("session_map")29session := NewSession()30session.NewMap("session_map")31session := NewSession()32session.GetMap("session_map")33session := NewSession()34session.NewMap("session_map")35session := NewSession()36session.GetMap("session_map")37session := NewSession()38session.NewMap("session_map")

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Selenoid automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful