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:
Code:
By byObject = By.id("issuetype-single-select"); driver.findElement(byObject).click();
Code:
By byObject = By.cssSelector("div#issuetype-sugestions a[title=Task]"); driver.findElement(byObject).click();
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:
None of those work. Help?????
I figured out one workaround, but it's a hack, so hoping somebody else will know a better way than this...
Example code to select "Bug" from the list of issue types which appear in the "issuetype-suggestions" div:
jQuery('div#issuetype-suggestions .active').removeClass('active'); jQuery('div#issuetype-suggestions a[title="Bug"]').parent().addClass('active'); jQuery('div#issuetype-suggestions a[title="Bug"]').click();
I have similar issue. Looking for a solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Additional things I've tried: * having a JavascriptExecutor click the <a> with JS * having a JavascriptExecutor mouseover the <a> and then click it with JS * modifying the class attribute for the <a> to add the additional class "active" * physically moving the mouse to hover over the <a> which is going to be clicked during a brief Thread.sleep pause In all of these cases as well as the cases described above, the click() being sent by Selenium or its JavascriptExecutor is not activating the JS JIRA uses to actually change the Issue Type field to the Issue Type selected from the drop-down. There's got to be some action/event I can generate in Selenium WebDriver directly or via a JavascriptExecutor that will properly tell JIRA to change the Issue Type, but I haven't found it. So for now, I insert a 10-second delay after "issuetype-suggestions" appears...and then manually click the Issue Type with my mouse. Somebody please help me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've also tried: * having Selenium2 / WebDriver click on the <img> node instead of the <a>: {code}By byObject = By.cssSelector("div#issuetype-sugestions a[title=Task] img");{code}, and * having Selenium2 / WebDriver click on the <li> node which is the parent of the <a> node: {code}By byObject = By.cssSelector("div#issuetype-sugestions a[title=Task]").findElement(By.xpath("..")); Still no luck...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.