Hi all,
We're testing out some custom JavaScript that changes the Description field when the Issue Type field is changed in the Create Issue dialog. I basically put listeners on "issuetype-field", "issuetype-suggestions", and "issuetype-single-select".
If I manually open a browser and click on Issue Type and change the Issue Type value myself by hand, the Create Issue dialog works as expected...and my JavaScript works without issue.
I then wrote some Selenium2 / WebDriver code to driver.findElement() WebElement objects and then execute the .click() method on those WebElement objects.
If I Debug execute the Selenium2 / WebDriver code within IntelliJ IDEA and manually step my way through the Selenium2 / WebDriver code, the Create Issue dialog works as expected...and my JavaScript works without issue.
However, if I Run execute the Selenium2 / WebDriver code within IntelliJ IDEA, the Create Issue dialog seems to stop working as expected...and so my JavaScript fails.
Here is my Selenium2 / WebDriver code:
- To change the issue type, I first need to click on the Issue Type drop-down (it has the id "issuetype-suggestions"):
- I next need to select an entry within the "issuetype-suggestions" section. Unfortunately, the entries don't have id attributes; instead, they have titles. Hence:
I've tried all kinds of things to remedy this in Run mode under the assumption that maybe there's some code which need to load behind the scenes before I execute the .click() method on the Task entry within "issuetype-suggestions" – thus a pause of some sort is necessary:
- WebDriverWait.until() with an ExpectedConditions clause that checks for both the "issuetype-suggestions" and Task title exist
- Thread.sleep(5000)
- using a JavascriptExecutor to check document.readyState == "complete"
None of those work. Help?????