The American Civil War already showed that large-scale set-piece battles in the open had become too costly, and that the future of warfare probably lay in entrechment and siege. Indeed, the New Zealand Wars had already made this point shockingly clear in the 1840s, when the vastly outnumbered and outgunned Maoris managed to repeatedly defeat the British by hiding in extremely well-designed earthen artillery bunkers until the enemy charged.
However, both these wars predated the so-called Firepower Revolution of the late 19th century (the introduction of breech-loading magazine rifles, breech-loading and recoilless artillery, high explosive shells, machine guns, etc). This technological revolution vastly increased the range, accuracy, destructive power and rate of fire of all firearms, making each individual soldier into a death machine. Charges across the open field became effective suicide as a single line of dug-in men with standard infantry equipment could wipe out an entire attacking division. It is said that by the early 20th century a brigade of 3,000 men could fire as many rounds and artillery shells in one minute as Wellington's 60,000 men had fired in the entire battle of Waterloo.
Several wars showed exactly what WW1 was going to be like. The most horrific (especially in hindsight) is the Russo-Japanese War of 1905, and the Siege of Port Arthur in particular.
Edit: source for most of this post is G. Wawro, Warfare and Society in Europe, 1792-1914.
The First World War was definitely not a completely new type of war. Rather, there were significant innovations that made clear the increasing obsoleteness of frontal assaults and massed line infantry tactics in general. Further, these were simply a continuation of changes brought about during the 1850s and 1860s. That is, telegraphs allowed for nearly instantaneous communication between higher headquarters and the commanders in the field. Rifled small arms shifted the crux of military power from manpower to firepower, and the balance of power far in favor of the defense. Also, railroads greatly extended the logistical trains of armies.
While it is true that the First World War saw inventions and innovations (namely aircraft, machine guns, and tanks) that heralded truly modern warfare (the blitzkrieg practiced by the Wehrmacht, and effectively duplicated by the United States military in the First Gulf War), they did not actually revolutionize battle tactics at the time. Airplanes were not capable of decisive close air support in the vein of what Stuka dive-bombers and P-47 Thunderbolts would carry out during the Second World War. Water-cooled machine guns were not mobile enough to enable individual soldiers to mow down entire squads like what German troops would do with the MP40 or FG42 in WWII. Tanks were too slow, lacked real firepower and range, and were introduced too late to make a difference in the outcome of late-war operations.