Working with Selenium IDE 2.9.1, a plugin for Firefox, I am trying to store the dynamically created ID of a new document and open it at the end. For example:
- I create a document, and the DataBase automatically assigns the ID: dp_137282
Following this, there is Selenium code that performs other tasks.
However, at the end, Selenium should locate my document by its ID and open it using a double click command.
Please review the code below:
<div id="content" style="height: 373px; width: 1324px;">
<div class="main-content" rel="kancelaria/rkp/rkp-faktury/type//rok_roboczy/2017">
<h3 class="gray">
<form class="form" action="kancelaria/rkp/rkp-faktury/type//rok_roboczy/2017" onsubmit="">
<input style="display:none;" value="asd" type="submit">
<div id="flex-list">
<table id="kancelaria-rkp-index" class="dark-gray overlap" style="width:100%;" headlines="">
<thead>
<tr id="dp_137282" class="multi-selectable" style="" ondblclick="this.className += ' doubleclicked'; Load.Content('kancelaria/rkp/szczegoly-rkp-faktury/id/dp_137282')" data-b="kancelaria/rkp/szczegoly-rkp-faktury/id/dp_137282" onclick="" data-status="">
Click here to view an image related to this topic
At the end, I used xpath in the Target field:
xpath=(//td[@onclick=' '])[7]
I have noticed that newly created documents by Selenium always appear at the top, so opening them shouldn't be an issue, but I prefer not to rely on this behavior. If anyone knows a solution and can share it, I would greatly appreciate it.