Subscribe Join 180,000+ subscribers and receive articles from our blog about software quality, testing, QA and security. Subscribe

Custom Report Obtain attachments

I have created a custom report to allow the tester to select individual tests and build a testcase review package, or share selective tests for external auditing In the php how could I obtain the testrail URL to avoid hard coding it in the php, IT have several TestRail instances (Production, dev, uat) and i want to avoid manually updating after an upgrade.

Current code is hardcode
$image = ‘http://testrail.x.y.z/index.php?attachments/get/’.$filename[0];

URL Not available in $_SERVER

Worked it out, in the html i am letting the browser obtain the image attachments using a Relative URL.

On the Client side the url was accessible in the javascript, to then callback to the testrail API to obtain more information when the user is creating the report e.g. user selects a suite and then use API to obtain tests in the suite for user to select.
External Safety Auditors seem happy with the report, but a pity it is not available by default.