Saving Searches
-Creates/Saves a search
-Loads/verifies the saved search
-Deletes the saved search
setTimeout 120000
openAndWait / (open the main interface)
waitForDispatchCompleted 30000
type entry source="*apache.error.log" /home/reba/public_html/images/bullet_image.gif startmonthsago=72
click entrySubmit (Click submit button)
waitForDispatchCompleted 10000
waitForElementPresent eventCount 500
comment If this fails with 107 events instead of 108, sourcetyper may be in an untrained state.
verifyText eventCount 108 results
comment Having gotten a search we want, we save it.
click menuBug
waitForElementPresent splunksMenu 5000
click saveThisSplunk
waitForElementPresent adminPopupLayer 5000
pause 1000
type //div[@id='adminPopupLayer']//input[@name='name'] apache saved search test
click //div[@id='adminPopupLayer']//input[@type='submit' and @value='Save']
pause 5000
comment Verify status message appears
verifyText //div[@id='msgNotificationContainer']//td[@class='INFO'] Saved search apache saved search test was updated.
waitForDispatchCompleted 30000
openAndWait / Go back to the home page to clear out the search
waitForDispatchCompleted 30000
comment verify it went into the 'saved searches' menu
click menuBug
waitForElementPresent splunksMenu 5000
click savedSplunksMenu
waitForElementPresent //label[@id='savedSplunksMenu']//label[.='apache saved search test'] 5000
comment Click on it to run it again.
click //label[@id='savedSplunksMenu']//label[.='apache saved search test']
waitForDispatchCompleted 30000
waitForElementPresent eventCount 500
comment Verify number of results are correct.
verifyText eventCount 108 results
pause 2000
comment Verify that the entry field has the correct search terms.
verifyValue entry source="*apache.error.log" /home/reba/public_html/images/bullet_image.gif
comment Attempt to Save Splunk with same name, verify that we get a warning.
click menuBug
waitForElementPresent splunksMenu 500
comment Bring up the save search popup again
click saveThisSplunk
waitForElementPresent adminPopupLayer 5000
pause 1000
comment Give it a name
type //div[@id='adminPopupLayer']//input[@name='name'] apache saved search test
comment Submit the form
click //div[@id='adminPopupLayer']//input[@type='submit' and @value='Save']
pause 2000
verifyText //div[@id='msgNotificationContainer']//td[@class='WARN'] Unable to save search: 'apache saved search test' because there is already a search with that name.
click menuBug
waitForElementPresent splunksMenu 500
click savedSplunksMenu
waitForElementPresent savedSplunksMenu 500
clickAndWait //label[.='Manage saved searches'] Click 'Manage saved searches'
selectWindow queryFetcher (hereafter, all selenium commands will act within the context of this iframe)
clickAndWait //a[.='apache saved search test'] Click the edit link
comment submit the form
clickAndWait //input[@type="submit"]
comment Look for correct header
verifyText //div[@class='noticeHeader']/b Saved search apache saved search test was updated.
clickAndWait //a[.='apache saved search test'] Click the edit link
verifyValue //textarea[@name='query'] source="*apache.error.log" /home/reba/public_html/images/bullet_image.gif startmonthsago=72
clickAndWait //input[@type="button" and @value="Cancel"]
comment Cleanup - Go delete the saved search we created.
check //td[.='apache saved search test']/preceding-sibling::td/input[@type='checkbox'] Check the box for that saved search.
clickAndWait //a[.='delete'] Click the delete link
assertConfirmation Are you sure you want to delete the selected searches?
verifyText //div[@class='noticeHeader']/b Deleted Saved search with name apache saved search test.