Looking for a way to create a CSS expression to select the "Select" option? I've experimented with various x paths, but I can't seem to get it to work on

  <div class="row-fluid">
  <table class="s-table table table-bordered table-striped table-hover">
  <thead class="p-table-head">
  <tbody class="p-table-body">
  <tr>
  <td>
  <td>
  <td>
  <td>
  <td>
  <td>
  <td>
  <td>
  <td>
  <td>
  <div id="div_2_1_2_1_1_1_10_r9" class="Action_Group CoachView CoachView_show" data- eventid="" data-viewid="Action_Group1" data-config="config_div_2_1_2_1_1_1_10_r9" data-bindingtype="" data-binding="" data-type="com.ibm.bpm.coach.Snapshot_9e739df9_ccc7_4dfa_9b75_8233150ad5bc.Action_Group">
  <div id="div_2_1_2_1_1_1_10_1_r9" class="ContentBox" data-view-managed="true" style="display: none;"> </div>
  <div class="s-action-group clearfix">
  <div class="l-nodeId" style=" display: none; "></div>
  <div class="p-action-group">
  <div id="div_2_1_2_1_1_1_10_1_1_r9" class="Action CoachView CoachView_show" data-      eventid="boundaryEvent_10" data-viewid="Action3" data-config="config_div_2_1_2_1_1_1_10_1_1_r9" data-bindingtype="" data-binding="" data-type="com.ibm.bpm.coach.Snapshot_9e739df9_ccc7_4dfa_9b75_8233150ad5bc.Action" style="background-color: transparent;">
 <button id="div_2_1_2_1_1_1_10_1_1_r9-lnk" type="button" style="display: none;">
<a class="p-action-link" href="#action" title="">
 <i style="display: none;"></i>
<span style="background-color: transparent;">Select</span>
</a>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>

In Firefox, the following x path expressions work fine, but in Internet Explorer they do not seem to be working:

//tbody[@class='p-table-body']/tr/td[10]/div/div/div/div/a/span

//table[@class='s-table table table-bordered table-striped table-hover']/tbody/tr[1]/td[10]/div/div/div[2]/div/a/span

//*[@id='div_2_1_2_1_1_1_10_1_1_r9']/a/span

Please note that although the scripts execute without errors, the main issue lies in Internet Explorer's inability to recognize and select the link of a customer.

Answer №1

Attempt

//*[@id='div_3_2_1_7_1_1_11_6_1_r8-lnk']/a/span

for the purpose of selecting

Answer №2

Perhaps just selecting the 'a' element could be more helpful in this case. It may not be necessary to include the span element in your selection process. For example:

By.cssSelector("#div_2_1_2_1_1_1_10_1_1_r9 a.p-action-link")

I would also like to offer a few suggestions.

  1. Consider using css selectors instead of xpath selectors. For more information, refer to selenium-docs

  2. When creating a selector, try to avoid being overly specific. Using something like "/tr/td[10]/div/div/div/div" is generally not recommended. Refer to Writing reliable locators for Selenium and WebDriver tests

Answer №3

Attempt to find the specific element by utilizing the textual identifier

driver.findElement(By.xpath("//a/span[text()='Choose']")).click();

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Display or conceal several elements upon hover using JQuery and HTML

Here is the current progress I have made: <div style = "position: relative;"> <a href = "#games"> <div class="sidenavOff"> <img src = "images/card_normal.png" /> <img src = "images/category_icons/icon_games.png" style = "positio ...

What is the best way to place a header in a specific location on a

As I continue working on my project, I am facing a challenge in positioning the headings in specific places. My ultimate goal is to achieve a look similar to Figure 1 for my headings. [Figure 1][1] However, as of now, my layout resembles Figure 2. I find ...

Attempting to devise a jQuery algorithm sorting method

To enhance the answer provided in this post: How to stack divs without spaces and maintain order on smaller screens using Bootstrap I've been exploring ways to develop a jQuery script that dynamically adjusts the margin-top of div elements based on t ...

Automating the process of navigating through pagination links using Selenium WebDriver's sets

I am new to using Selenium and I encountered a unique situation while scraping a website (page). The website does not have a traditional next page button for pagination. Instead, the pages change only when you click on the "..." option to reveal the next s ...

Retrieve CSS height using Jquery, based on the declared value rather than the computed value

In a previous version of jQuery, the default behavior was different. When I use .css("height") and .height(), it gives me the computed height instead of what I actually want. I only need the height value if it is explicitly declared in the CSS for that ele ...

What is the best way to adjust the volume vertically?

I successfully transformed my volume slider from horizontal to vertical using CSS. However, the functionality of the volume slider still behaves as if it were horizontal. In other words, I have to click horizontally to adjust the volume instead of vertical ...

Positioning the tiny rectangle containing the information icon within the larger horizontal rectangle

In the image attached, I am creating a horizontal rectangle.horizontal rectangle Using the following CSS, I am able to create a horizontal rectangle on my div: .Rectangle { width: 516px; height: 50px; border-radius: 4px; border: solid 1px rgba(78 ...

Difficulty with Jquery's random selection of grid divs

I am working on a grid layout consisting of 9 divs nested in columns of three. The objective is that when the main grid (with ID #left) is clicked, two divs from the middle row (row="1") should have the class .show randomly applied to them. In the column w ...

Height transition animation in Angular 2 - maintaining state consistency

I am currently working with an animation code that is linked to my component. animations:[ trigger('slide', [ state('show', style({ height: '*' })), state('hide ...

When using Selenium Webdriver in Java, encountering the issue of the first letter missing from an input field

When using Selenium WebDriver, I encountered a problem while trying to fill out the phone number field. Even with a placeholder value of "(__) -", the driver completes the task too quickly and misses the first digit in 40% of my tests. For example, if the ...

The nested CSS grid is failing to show its nested elements on the page

Having trouble with a nested CSS GRID - the child grid items are not appearing correctly despite multiple checks on the markup. The first grid row should span three columns, as it does, and is set to display:grid with 2 child grid items. However, the chil ...

Protractor performs flawlessly in Chrome, but encounters issues running in Firefox

After starting to build out my simple test suite, I encountered the following error in the log: WebDriverError: Firefox option was set, but is not a FirefoxOption: {} The versions I'm using are: Node v7.5.0 Protractor v5.1.1 Selenium Webdriver v3. ...

Establishing limits for a division using keyboard commands

Alright, I've decided to remove my code from this post and instead provide a link for you to view it all here: (please disregard any SQL errors) If you click on a Grid-Node, the character will move to that position with boundaries enabled. Draggi ...

Transforming navigation bar icons to active using Django and JavaScript

I recently created a navbar using Bootstrap 4 and I'm looking for a more efficient way to toggle the active icon on the current page. Here's my current setup: <li class="nav-item"><a href="/" id="A" {% if request.p ...

Position the image, text, and header within a box in uniform alignment

Currently, I am working on a design that includes an image, a header, and some text inside a box. However, I am facing an issue with aligning the header so that it appears above the rest of the text. The layout is not turning out as expected. https://i.ss ...

Tips for displaying the Font Awesome icons

I have included Font Awesome icons within the <span> tags and applied the necessary styles in my CSS file. However, the icon is not being displayed correctly. I am looking for a solution to ensure the correct display of the icons. The HTML code wher ...

Automating web interactions with Python and GeckoDriver

Hello, I'm currently attempting to launch Firefox browser using a basic method. I have tried using the executable path with an if statement as well as without an if statement, but unfortunately the browser is still not opening. I have checked the shel ...

The background-repeat property in CSS appears to cease functioning when the container becomes too wide

Exploring various combinations of space and round values for background-repeat, I've discovered a way to utilize radial gradients to create a visually appealing dotted border on an element without having the dots cut off. .test { background-repeat: ...

Encountering a stagnant element while performing Selenium testing in the C3 framework

Currently, I am utilizing Selenium testing and have identified all div elements with an id containing a specific name (in this case, "center-"). var x = driver.FindElements(By.XPath("//div[contains(@id, 'center-')]")); When attempting to itera ...

Design elements - Responsive vertical images

I am facing an issue with resizing the slider I have on my website. Currently, it is set at 1200 x 400 pixels, and while the width adjusts correctly when the page is resized, the height remains fixed at 400px. I would like the height to resize proportional ...