0
votes

I need to click on the fields bug, epic, feature, issue and task which appear on click the "+" icon. I inspect each of the elements and the see the same common xpath highlighted in the image in developer tool. How do i find the xpath of each of the elements highlighted and click on them using selenium webdriver? enter image description here

<body class="lwp">
  <noscript><div class="absolute-fill flex-column flex-center"><h2>JavaScript is Disabled</h2><p>Please enable javascript and refresh the page</p></div></noscript>
  <input type="hidden" name="__RequestVerificationToken" value="t6WnlqRwnH3QtDIOt2b3JiHWYI1V5vB3MheOCOTH7Fx6QaBNoXWz4k8P4luP9i7TYw70KVq4O2vuwa8DQRuLcdUxo_KKVjcmxorJTHAE3c42sdjYqojLZkOSNt1gad70mD0BBA2" />
  <div data-componentregion="page" class="full-size"></div>
  <div class="bolt-portal-host absolute-fill no-events scroll-hidden"></div>
</body>
2
Please post + button html in text format as well bug, epic, feature, issue and task html in text format. Otherwise its very difficult to answer your query.Most importantly post some code trail as well.KunduK
List<WebElement> allItems= mydriver.findElements(By.xpath("//div[@class='bolt-portal-host absolute-fill no-events scroll-hidden']")); System.out.println(allItems.size()); with the above code, i get the size as 1 while i was expecting the size to show up as 6(6 elements shown on UI on clicking the + icon) which means that i cannot use the mentioned xpath to click on the elementsSonal
Can you expand the div element and check what is there?KunduK
Can you share the HTML/DOM for the highlighted section(after clicking on + icon -> you get the highlighted section). In the screenshot of the Inspector -> you have highlighted the parent div(open the div - so that we can help you better). It would definitely contain some text - Bug/Epic/Feature etc.Atul
@Atul expanding the div tag doesn't show anything further. the same div tag shows up when i inspect each of the elements after clicking on the + iconSonal

2 Answers

0
votes

You need to handle windows here because when you click "+" new window appearing with elements "bug","epic","feature",,,etc

  • should be parent window and "epic",,,, are child window
0
votes

I could not identify unique xpath for the elements as all the elements had same xpath. using sikulix library solved my problem