Andy Zhang
Katalon Apprentice
01/10/2018
edited January 10

How can I set cookies for my browsers in Katalon?

As the title says

Thanks for help.
Upvote
Quote

Comments

  • Ana Hong
    Katalon Apprentice
    01/10/2018
    It is quite easy:

    import org.openqa.selenium.Cookie
    import org.openqa.selenium.WebDriver
    import com.kms.katalon.core.webui.driver.DriverFactory
    Cookie ck = new Cookie("name", "value");
    WebDriver driver = DriverFactory.getWebDriver()
    driver.manage().addCookie(ck)
    Upvote
    Quote
  • Andy Zhang
    Katalon Apprentice
    01/10/2018

    @Ana Hong said:
    It is quite easy:

    import org.openqa.selenium.Cookie
    import org.openqa.selenium.WebDriver
    import com.kms.katalon.core.webui.driver.DriverFactory
    Cookie ck = new Cookie("name", "value");
    WebDriver driver = DriverFactory.getWebDriver()
    driver.manage().addCookie(ck)

    Thank you

    Upvote
    Quote
  • Victor
    Katalon Apprentice
    08/02/2018
    hello! I have some issue. I made as you offer and I get this

    FAILED because (of) org.openqa.selenium.WebDriverException: unable to set cookie

      (Session info: chrome=68.0.3440.84)

      (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)

    How to resolve this problem?
    Upvote
    Quote
  • Andrej Podhajský
    Katalon Expert
    08/02/2018
    is your browser up&running?
    Upvote
    Quote
  • Victor
    Katalon Apprentice
    08/02/2018
    yes
    Upvote
    Quote
  • Elena Myers
    Katalon Apprentice
    09/21/2018
    I am having the same problem:

    FAILED because (of) org.openqa.selenium.WebDriverException: unable to set cookie

      (Session info: chrome=68.0.3440.84)

      (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)


    Any solutions how to resolve it?

    Thank you.

    Upvote
    Quote
Sign In or Register to comment.