2

Answer

Thank you for all contributions to my issue. I end up my case with the following steps

  1. Keep same code.
  2. Create excel file to generate JSON based on specific condition.
  3. Copy JSON on excel file to script (//TODO: read from Excel)

Question

I'm working a project that transform raw data to a chart to build a report.

I'm using Selenium to automate this site, the ultimate goal of this automation project is checking if data of chart returns correctly or not. Each option on the form will effect to how the data returns (and also chart displays but we just check data, we trust GoogleChart for displaying part).

The issue I face here is that the form is too complex: a lot of options and nested options

Sample form structure (please find an attachment for full structure)

  • GeneralInfo
    • chartType
  • Variable1
    • function
    • showPercentage
    • ...
    • categories (2 more nested level here)
  • Variable2: same as 1
  • Filter
    • variableName
    • operator
    • value
  • Option: 10+ options here

My solution

  1. I implement a method CreateNewChart(string jsonString)
  2. Create json for each case (e.g sort ASC, DESC, show percentage, ...)

It works but I see it is not a good solution

  • Easy to make mistake with json (you always need to take a look at a long long json string :) )
  • Hard for maintainance if json structure changes
  • ...

I'm looking forward for more easier way to handle this one. Any advice, suggestion, comment are welcome.

Thanks.

Form editor

5
  • Basic advice: If the whole is too complex, chop it up. In this case that would be unit-test style test-cases that tackle each function separately.
    – Bookeater
    Jul 15, 2016 at 8:12
  • Thanks for your advice. I wish I can chop it up, but don't know how to do since each option may effect to the returned data (e.g. user wants to create a chart that only gets top 10 airports in Europe which has the highest customer satisfaction then sorting it by alphabet.)
    – Tam Minh
    Jul 15, 2016 at 8:22
  • Indeed threshold often is the need to mock the environment. Can you ask help from development? API level tests may be where you can make the real difference.
    – Bookeater
    Jul 15, 2016 at 8:25
  • Basic advice #2: Define and limit yourself to a set of reasonable scenario's. You will miss out on broad coverage that way, though.
    – Bookeater
    Jul 15, 2016 at 8:26
  • #3: As you can see there are a lot of option for charts, most of them are inherited from Google, we just make a form and try to let user can define a chart that fits their needs. For the API level tests question, yes our team follows TDD so we have unit tests and API tests but it still needs to double-check on UI again. #4: Thanks, I will consider this one. Though, it's hard to explain since your form supports this option/function but error happens when combining them :)
    – Tam Minh
    Jul 15, 2016 at 8:36

3 Answers 3

0

It sounds like "Too complex" means that it would need considerable time, resources and money to do what you wish to achieve. It does not sound like 'too complex' means it can't be done period.

Suggest you gather additional resources and get management on-board as to the scope of the project and what it will take to have good testing.

1
  • Maybe you misunderstand me, at this time I can automate that form but due to the complexity of form so my solution/code looks not good, so I want to find a better way to handle it.
    – Tam Minh
    Jul 18, 2016 at 2:37
0

Preparation and planning is the key.

Break the functionality in smaller steps, use page objects.

Check this similar post to see some general tips to keep in mind: how-to-automate-functionality-of-this-complex-web-application

0

Thank you for all contributions to my issue. I end up my case with the following steps

  1. Keep same code.
  2. Create excel file to generate JSON based on specific condition.
  3. Copy JSON on excel file to script (//TODO: read from Excel)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.