0

I'm trying to find a dynamic Web Element, so I can't find by ID or Xpath. I tried to found using "Tab" or using another keyboard command unsuccessfully.

On another page with this same condition I tried the following code and it work:

            public void SeachApp() {
            WebElement elem = driver.findElement(By.xpath("//*[contains(text(),'BaseAloca')]"));
                int width = ((WebElement) elem).getSize().getWidth();

                Actions act = new Actions(driver);
                act.moveToElement((WebElement) elem).moveByOffset((width/2)-2 0).click().perform();
        }

But on this new page is not working. This is the page:

enter image description here

HTML code Page 1:

<circle class="bubble" r="48" style="filter: url(&quot;https://us.qlikcloud.com/node/i-0fc3fc8cc088b4fb7/sense/app/b5573a15-e951-45b5-81ed-92ef95c916bc/datamanager/datamanager#bubble-drop-shadow&quot;); fill: url(&quot;https://us.qlikcloud.com/node/i-0fc3fc8cc088b4fb7/sense/app/b5573a15-e951-45b5-81ed-92ef95c916bc/datamanager/datamanager#bubble-fill&quot;);"></circle>

<text class="label" y="5" text-anchor="middle">BaseAloca</text>

There is another page that I can do this click: enter image description here

HTML code Page 2:

<iframe id="appFrame" ng-mouseenter="refreshCookies()" tenantid="5b5f0e2aa543a3be1cf15913" ng-src="/node/i-01bc83ae6124b5e05/sense/app/22110b43-a3d3-4d3e-8d45-c944f216fbab?instance=qlik-i-01bc83ae6124b5e05" src="/node/i-01bc83ae6124b5e05/sense/app/22110b43-a3d3-4d3e-8d45-c944f216fbab?instance=qlik-i-01bc83ae6124b5e05"></iframe>

<div class="table-inner" ng-class="{ 'selected': isTableSelected(), 'nointeraction':!enableSelection() }" ng-click="selectTable($event)" ng-dblclick="editObject($event)" ng-disabled="true" aria-disabled="true" disabled="disabled">
    <div class="icon lui-icon lui-icon--table" ng-class="{ 'pending-delete': isTableDeleted() }"></div>
    <!-- ngIf: canSplit -->
    <!-- ngIf: showSelectionState  -->
    <div class="table-actions" ng-class="{ 'pending-delete': isTableDeleted() }">
        <!-- ngIf: tableObj.sourceType === 'ScriptTable' -->

        <!-- ngIf: canSplit && !disableButtons && !splitIndividualTablesFeature -->
        <!-- ngIf: canSplit && !disableButtons && splitIndividualTablesFeature -->
        <!-- ngIf: tableObj.isFiltered && !disableButtons && !canSplit -->
        <!-- ngIf: canEdit && !disableButtons --><div class="action-icon lui-icon lui-icon--edit qui-btn-icn lui-btn-div ng-scope" q-title-translation="DataManager.Overview.Tooltip.Edit" ng-if="canEdit &amp;&amp; !disableButtons" ng-click="onTableEditClick($event)" title="Edit this table"></div><!-- end ngIf: canEdit && !disableButtons -->
        <!-- ngIf: canDelete && !disableButtons --><div class="action-icon lui-icon lui-icon--bin qui-btn-icn lui-btn-div ng-scope" q-title-translation="DataManager.Overview.Tooltip.Delete" ng-if="canDelete &amp;&amp; !disableButtons" ng-click="onTableDeleteClick($event)" title="Delete this table"></div><!-- end ngIf: canDelete && !disableButtons -->

    </div>
    <div class="table-information" ng-class="{ 'pending-delete': isTableDeleted() }">
        <div class="table-name ng-binding" ng-bind="tableObj.name" title="BaseAloca">BaseAloca</div>
        <!-- ngIf: tableObj.hint -->
        <div class="table-subtitle ng-binding" ng-bind="tableObj.sourceName" title="Proj.xlsm">Proj.xlsm</div>
    </div>
    <!-- ngIf: !pendingAction --><div class="status-bar ng-scope" ng-class="pendingAction.class" ng-if="!pendingAction">
        <div class="left-side">
            <!-- ngIf: tableObj.fields.length > 0 --><div class="fields ng-binding ng-scope" ng-if="tableObj.fields.length > 0">Fields: 40</div><!-- end ngIf: tableObj.fields.length > 0 -->
            <!-- ngIf: hasGeoField() -->
            <div class="status-icon" ng-class="{true: 'lui-icon lui-icon--script'}[tableObj.sourceType === 'ScriptTable']" q-title-translation="DataManager.Overview.SynchronizeTooltip" title="Click to open the synchronization option for scripted tables"></div>
            <!-- ngIf: tableObj.isFiltered -->
        </div>
    </div><!-- end ngIf: !pendingAction -->
    <!-- ngIf: pendingAction -->

</div>

Can you help me?

4
  • 2
    Share HTML for the same. Also try "//*[contains(.,'BaseAloca')]" Commented Aug 29, 2018 at 17:36
  • 1
    The <circle> tag is from the svg namespace. Check this discussion how to deal with svg elements stackoverflow.com/questions/41829000/… Commented Aug 29, 2018 at 18:22
  • 2
    The HTML you posted doesn't contain the text 'BaseAloca'. Where is the HTML with that text? Maybe post more of the surrounding HTML. Is this area inside an IFRAME? Commented Aug 29, 2018 at 19:38
  • Now is the full code! Thanks Commented Aug 30, 2018 at 12:09

1 Answer 1

1

You can try following code to identify this particular "bubble" class element:

WebElement elem = driver.findElement(By.xpath("//*[name()='circle'][contains(@style,'https://us.qlikcloud.com/node/i-0fc3fc8cc088b4fb7/sense/app/b5573a15-e951-45b5-81ed-92ef95c916bc/datamanager/datamanager#bubble-drop-shadow')]"));

Update #1:

driver.switchTo().frame("appFrame");     //need to switch to this frame before identifying elements present on frame with id "appFrame"
WebElement elem = driver.findElement(By.xpath("//div[@class='table-information']/div[@title='BaseAloca']"));
Sign up to request clarification or add additional context in comments.

6 Comments

It doesn't work =( o such element: Unable to locate element: {"method":"xpath","selector":"//*[name()='circle'][contains(@style,'us.qlikcloud.com/node/i-0fc3fc8cc088b4fb7/sense/app/…"}
I don't see any <circle> tag inside your HTML code Page 2
I have two ways to update these tables, the first one is on page 1 (Circle), and the second is page 2 (Table object). If I could click on one of these two ways is fine! =).
what error do you get when you try update#1, also please check if your table is inside an iframe or not
@CleicyGuiãoyou need to first switch to "appFrame" before interacting with elements on the frame using driver.switchTo(), check my updated #1 section.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.