5

I'm trying to use Selenium IDE to click on a swf in a html page. The DIV id and Embed id change depend on the timestamp e.g. id="FLASH_0_23458974594", I've tried using id=/^FLASH_([0-9]+_)[0-9]([0-9]+)/ or id="FLASH_glob:*" but the IDE is not picking up the swf. Am I doing something wrong here?

Thanks.

4 Answers 4

3

Have you tried contains?

click | //object[contains(@id,'FLASH_')]
Sign up to request clarification or add additional context in comments.

6 Comments

I just did, and it didn't work. I got this error: [error] locator not found: //object[contains(@id,'FLASH_')], error = Error: Element //object[contains(@id,'FLASH_')] not found
Just saw that you are using embed tags. You might need to replace 'object' with 'embed'. Otherwise, can you add the relevant HTML from the page to your question.
IDE able to detect it using embed, but it's not clicking it. In the log it shows - [info] Executing: |click | //embed[contains(@id,'FLASH_')] | | but it's not clicking it.
Looked around some more. Doesn't look like you are going to be able to click the Flash object within the Selenium IDE. You need to use Selenium RC and a plugin. clearspace.openqa.org/message/59114
I actually do use Selenium RC, I was using the IDE to verify if it'd work or not. I'd seen the link you sent before, the problem is I'm actually working on AS2 and so the google code won't be able to do what I want. Thanks.
|
2

Clicking on the flash object won't work. The only known way to automate Flash using Selenium is to expose UI functions in the Flash object via JavaScript. Then you can call that JavaScript using the getEval() function in Selenium RC.

Comments

1

This topic is quite old, but as I spent many times to find a solution, I answer this question. As said @Zugwalt, you can use Java Robot class. But in case, you use Selenium Grid and so a RemoteWebDriver, you can use jsch to open an ssh connection to your remote machine and call xdotool to click on a given position.

You can see an example on this Gist

1 Comment

My last job we started using Sikuli with webdriver, it worked pretty well for us.
0

We use the Java client for selenium and sometimes have our tests use the Java Robot to move the mouse and click when we cannot interact with the web browser directly. This has downsides (such as the browser must be in the foreground and accuracy can be a bit tricky) but when running tests in a virtual machine these downsides are minimized.

Comments

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.