 
   openContextMenu: (browser) ->
 
-    fileSelector = ' .untitledtxt.active'
+    fileSelector    = "#{tabHandleSelector} .untitledtxt.active"
+    optionsSelector = "#{fileSelector} span.options"
 
     browser
-      .waitForElementVisible  paneSelector + fileSelector, 20000
-      .moveToElement          paneSelector + fileSelector, 60, 17
-      .moveToElement          paneSelector + fileSelector + ' span.options', 8, 8
-      .waitForElementVisible  paneSelector + fileSelector + ' span.options', 20000
-      .click                  paneSelector + fileSelector + ' span.options'
+      .waitForElementVisible  fileSelector, 20000
+      .moveToElement          fileSelector, 60, 17
+      .moveToElement          optionsSelector, 8, 8
+      .waitForElementVisible  optionsSelector, 20000
+      .click                  optionsSelector
       .waitForElementVisible  '.kdlistview-contextmenu', 20000 # Assertion
 
 

helpers      = require './helpers.js'
paneSelector = '.pane-wrapper .kdsplitview-panel.panel-1 .application-tab-handle-holder'

module.exports =

  openNewFile: (browser) ->

    activeEditorSelector = '.pane-wrapper .kdsplitview-panel.panel-1 .kdtabpaneview.active .ace_content'
    plusSelector         = paneSelector + ' .visible-tab-handle.plus'

    browser
      .waitForElementVisible  plusSelector, 20000

      .clearValue             saveAsInputSelector
      .setValue               saveAsInputSelector, newName
      .click                  saveButtonSelector
      .waitForElementVisible  "#{tabHandleSelector} div[title='#{newName}']", 20000 # Assertion
      .waitForElementVisible  filesTabSelector, 20000
      .assert.containsText    filesTabSelector, newName # Assertion

