Ruby automated data-driven

Source: Internet
Author: User

You have written a script for the new feature, but this feature does not allow adding records of the same name. What should I do?

Delete related records during initialization? If you are not familiar with the business, the table structure, and the relationship between the master and slave tables are complex, what should you do?

Can I manually change the driver data before each operation? Trouble!

I thought of a stupid way.

Add an event to the Excel driver file:

Private sub workbook_activate ()

Sheet3.cells (2, 6) = sheet3.cells (2, 6) + 1

Thisworkbook. Save

End sub

Add a method to the ruby script:

Def open_excel (data_source)
Begin
Excel = win32ole. New ("Excel. application ")
Excel. Visible = true
Workbook = excel. workbooks. Open (data_source)
Workbook. Close
Excel. Quit
Rescue => E
Raise E
End
End

Finally, it is referenced in run_testcase.

To put it simply, run-> open excel in ruby-> Add and save cells and values in Excel-> close excel in Ruby automatically

Good land ?! There should be a lot of other ideas, and we will try again later.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.