How can I manage Cross Origin Tests in Karate UI Automation

37 Views Asked by At

Feature: Test Senetel Webapp

    Scenario: Login with incorrect credentials
        Given configure driver = {type: 'chrome', addOptions:["--remote-allow-origins=*"], port: 9515, executable: 'C://Program Files//Google//Chrome//Application//chrome.exe'}"
      When driver 'https://fmsso-acpt.fanniemae.com/'
      And driver.maximize()
      And delay(3000)
      And input("#username","d33k4cnt")
      And input("#password","Dec_2023")
      And delay(3000)
      And click("//a[@id='signOnButton']")
      And delay(3000)
      And driver 'https://web.pr360b.sfbu.acpt.intgfanniemae.com/#/home'
      And delay(12000)
      And waitForUrl("https://web.pr360b.sfbu.acpt/#")

https://fmsso-acpt.fanniemae.com/ -> this is my login page and once I login, the url changes to this one https://web.pr360b.sfbu.acpt/# which is the home page.

Now, I want to access the elements on the home page but I cannot access them because of the cross origins. Can someone please tell if karate UI automation can do cross origin tests. If yes, how will I be able to do that?

0

There are 0 best solutions below