gemini icon indicating copy to clipboard operation
gemini copied to clipboard

[Cookie][Chrome] Can any one could provide a cookie example when using chrome

Open Kenith opened this issue 7 years ago • 4 comments

Hello All,

We would like to load cookie before accessing the urls. Is there anyone could provide a sample about how to use cookie with Gemini + Chrome?

Really appreciate for your help in advance.

Thank you, Ken

Kenith avatar Mar 01 '18 10:03 Kenith

I tried followings, failed:

gemini.suite('1', function(suite) {

    suite
        .setUrl('http://127.0.0.1:8080/', function(actions) {
            actions.setCookie({"name": "ken", "value": "tomato", "url": "http://127.0.0.1:8080"})
        })
        .setCaptureElements('html')
        .capture('plain', function(actions) {
            actions.waitForElementToShow('ken', 30000)
        })
});

Kenith avatar Mar 01 '18 11:03 Kenith

How about executeJS?

Hrommi avatar Mar 13 '18 12:03 Hrommi

@Hrommi Sorry for the delay, and really appreciate for your help.

As far as I know, the executeJS could only be run after page load. Is it possible to set the cookie before the page load?

Thank you, Ken

Kenith avatar Apr 21 '18 09:04 Kenith

It can be done with executeJS this way: https://github.com/gemini-testing/gemini/issues/799

wabisabit avatar Jun 20 '18 08:06 wabisabit