---
title: "How would I access a pop ui button?"
author: "lilingjay"
date: "2012-03-31T23:29:34Z"
tags: []
categories: ["开源软件"]
slug: "how-would-i-access-a-pop-ui-button"
draft: false
lastmod: "2012-03-31T23:34:31Z"
id: 1472014
url: "https://lilingjay.iteye.com/blog/1472014"
---

原文链接：[http://stackoverflow.com/questions/5958075/how-would-i-access-a-pop-ui-button](http://stackoverflow.com/questions/5958075/how-would-i-access-a-pop-ui-button)

 

Question:

I have a pop up button that is triggered by deleting an object. How can I click the button if I can seem to find it.

I have used xpath like so:

```
$browser.button(:xpath, "/html/body/div/div/div/div/div/div/button").click
```

Here is a code snippet: ![The text is Highlighted.](http://i.stack.imgur.com/PlZRg.png)

Thanks in advance.

 

Answers:

 

Try this:

```
browser.span(:text => "Delete").click
```

or

```
browser.span(:class => "ui-button-text).click
```

or

```
browser.button(:class => /ui-button/).click
```