1

I have this page where an angularjs modal-content popup, in there i fill up some fields and click save. After save is initiated, popup should dissapear an event should happen and so on.

My selenium test does all that perfectly except that when it clicks on the save button, popup dissapears but no event is triggered or saved so when i open up the window again everything is empty. I've tried stuff that i know with selenium and it still doesn't work. Can anyone help me out here?

This is the save button:

<button class="save-button" data-ng-click="onSettingsSave()" ng-hide="readOnlyMode || !canSave()">Save</button>

Stuff i've tried:

var saveButton = driver.FindElement(By.CssSelector("button.save-button"));
saveButton.Click();

var saveButton = driver.FindElement(By.XPath(saveXpath));
saveButton.SendKeys(Keys.Enter);

((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].focus();",saveButton);
((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].click();",saveButton );
Sudharsan S
  • 15,058
  • 3
  • 28
  • 49
fimo
  • 11
  • 2
  • 1
    What kind of exception you are getting? – Saifur Jul 13 '15 at 12:39
  • There is no exceptions, everything acts like its working fine but nothing is saved when the click happens through selenium on Save button. Window is just closed without triggering the "onSettingsSave()" function hence nothing saves. – fimo Jul 13 '15 at 16:14

1 Answers1

1

Try force clicking the element using pure JS:

driver.execute_script("arguments[0].click();", yourElement)

csaladenes
  • 784
  • 1
  • 6
  • 23