Usecase:
Step 1: Invoke Selenium and traverse till page 2 and quit
Step 2: Invoke Sikuli perform some actions in windows and exit
Step 3: Now invoke Selenium and continue from page 2 or where replay was stopped.
Replay should start from page 2 but I always end-up in starting from home-page. So is there a way to create and send unique cookie for each page traversed in Selenium and can be used later.
I get cookies before exiting from page 2(Step1) and restore them back at Step 3.But it always take me to home page.
So I'm looking for an option whether we can create unique cookies to each page(page 2) and use it to traverse directly to page 2 insteaed of home page.
pseudo code as below:
//setting user-defined cookie
HttpCookie cookie = new HttpCookie(cookieName,cvalue);
cookie.setDomain(domain);
cookie.setPath(path);
cookie.setMaxAge(3600);
cookie.setSecure(flag);
Above is the cookie which I generated before exiting from Step 2
Sysout(cookie);
test=754895648; expires=Wed, 13 Jun 2029 04:53:44 IST; path=/; domain=vdevpril0.com;secure;
Passing below uniquely created cookie along with original cookie captured
Cookie ck1 = new Cookie(name,value,domain,path,expiry,true);//auto captured cookie by selenium driver
Cookie ck2 = new Cookie(name,value,domain,path,expiry,true);//user-defined cookie
driver.manage().addCookie(ck1);
driver.manage().addCookie(ck2);
If i pass just ck2, I will be in login page. ck1 helps me to auto-login and stops.
Expected: Step 3 should take me to page 2
Actual: Step 3 takes to home page