question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fixture json data will not populate properly for a select value

See original GitHub issue

Current behavior:

Using fixture data variable from a fixture.json file, Cypress is unable to locate a select even though it located the exact same value when it was hard coded.

Example: Without Fixture:

cy.get('#expire_month_display').select('11')  <---value is actually 11 not the label or name.
 With fixture data var:
cy.get('#expire_month_display').select(data.oeMonth)

Here is the json:

"oeMonth": 11,

Desired behavior:

Fixture data should populate properly the value for selects

Test code to reproduce

See above, i am running tests on a payment gateway and prefer not to disclose our credentials in th test code.

Versions

Chrome

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
theTestingApproachcommented, Oct 11, 2021

Hi @rolu315 how did you make this work… i am facing the same issue.thank you

0reactions
amitkalyancommented, Sep 7, 2022

Hi,@theTestingApproach please help me out resolving this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compare json file and dropdown values displayed in an ...
In the dropdown, the rest of the values are in the JSON file. I have done the below but it is not working....
Read more >
Populate a Select Dropdown List using JSON - Code by Amir
A common requirement when developing forms on the web is populating a dropdown list using data from a web service or external file....
Read more >
Reading and testing JSON object in Cypress - Filip Hric
Ever got that frustrating Cannot read property 'x' of undefined error? If you are starting with JSON objects, it is easy to get...
Read more >
django-admin and manage.py
django-admin is Django's command-line utility for administrative tasks. ... If it's not in your path, ensure you have your virtual environment activated.
Read more >
writeFile - Cypress Documentation
If the path to the file does not exist, the file and its path will be created. ... {projectRoot}/path/to/data.json will be created with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found