Closed chiragverma closed 5 years ago
@Chiragverma can you try NOT using XPath selectors, and instead using regular jQuery selectors? This might be a bug in cypress-xpath
@bahmutov ,yes i can remove that, but i do not think i am getting the error because of that
@bahmutov , i replaced my xpath with - cy.get('[data-test="login"]').click() but still the same error
The error seems to indicate that the error is being thrown from within your application code https://ca.letgo.com/assets/18-chunk-modern-9dec58866b3bf120338d.js:1
,
Can you click the yellow error in Cypress during cypress open
with Develop Tools open? This should print the full stack trace to the console where you can see and debug where the error is thrown exactly.
@jennifer I know there is a way to turn this error off by listening to the 'uncaught:exception' event for application code. But when I use it in my tests or include it in support/index.js. It does not work. Can you help me take a look at this issue.
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})
@smart625 Please see this issue for not being able to catch uncaught errors thrown from 3rd party applications https://github.com/cypress-io/cypress/issues/987
can any give me suggestion about this issue, this issue only comes when invalid data is tested
it("Test case for invalid data member(PlayerMaxCreditLimit) ", function () {
// This test case will run for valid user name and password for given no of times
let test_case_no = "membercreate_testcase_1"
const api_url = 'https://users.royalexch.in/api/Member/saveMemberData'
var random_text = ""
let method = "POST"
let n = 1; // run for no of times
var return_parameters = ""
let return_data = ""
let expected_result = "unSuccessfull"
var parameters = {}
cy.genRandomString(10).then((random_text) => {
console.log("log2 = " + random_text)
parameters = {
"sportsbook":false,
"casino":true,
"status":"Active",
"currencyType":"POINTS",
"username":random_text,
"password":"abc123",
"rate":[{"_id":"5acc4a22dd70161213c041c6",
"game":{"_id":"5a818572650cb46dd9b1a25a",
"name":"Live Casino"},
"parentRatePercent":1,
"memberRatePercent":1,
"maxRate":100
},
{"_id":"5b3632d1b708ec118b2430de",
"game":{"_id":"5b36053e46123555cca93993",
"name":"SportsBook"},
"memberRatePercent":1,
"parentRatePercent":1,
"maxRate":100}],
"minRate":[{"_id":"5b716378624646623398342d",
"game":{"_id":"5b36053e46123555cca93993",
"name":"SportsBook"},
"memberMinRate":10,
"parentMinRate":10}],
"commission":[{"_id":"5a9f93d0295af33293afe445",
"game":{"_id":"5a6185a73d9e1f24a8882d05","name":"TeenPatti"},
"memberCommissionPercent":0,
"parentCommissionPercent":3,
"totalCommission":3},
{"_id":"5a9e526eea8c5a54f001c6cc",
"game":{"_id":"5a6185bb3d9e1f24a8882d06","name":"Poker"},
"parentCommissionPercent":3,
"memberCommissionPercent":0,
"totalCommission":3}],
"displayName": random_text,
"comment": random_text,
"cpassword":"abc123",
"creditLimit":10000,
"SuperMasterMaxCreditLimit":10000,
"MasterMaxCreditLimit":1000,
"PlayerMaxCreditLimit":100000,
"_accessToken":accessToken,
"currencyRate":1000
}
cy.call_url(n,method,api_url,parameters,test_case_no,return_parameters,expected_result).then((return_data) => {
console.log("log2 = " + return_data['data']['data']['username'])
})
})
})
I am trying to write a automation code but everytime i try to click on the sign up button i get this error:
I have tried
.focus()
but none of it seems to work.Here is my current working cypress code: