In Selenium IDE, the application has got image as button. The click event for that is not capturing. Is there any alternative Selenium Commands available for that or otherwise, is there any JavaScript user extensions can be added?
Please help.
Thanks
Yes.. the image will act as a button..
Found a solution for that!!
Simply added a JavaScript code which supports clickAt() commands.
To detect button as image you can use one of the below solution
xpath=//img[#src='/images/logo_home.png']
xpath=//img[#alt='Home']
//img[#src='/images/logo_home.png']
Related
I am using webdriver.io framework. At my application, I have a button that opens a Windows Open prompt (Native), and there I need to choose a folder/file and click Open.
Then returning to my application and continue.
Is there a way to move focus on to this window and control it (Select a path and click Open)?
If not- Is there any other solution someone can offer?
The short answer is probably not, you can't control native dialogs from webdriver.
If it's a file input type for which you want to set a file, you might possibly use webdriver to evaluate a piece of javascript to set the HTMLInputElement.files value of the input element.
This works in modern browsers as mentioned in the mozilla docs
I am trying to automate a website built in Rebellion UI. However, even if the button is found, Selenium is not able to click on it. Has anybody faced such issue before or has Any idea about it?
I clicked using usual click and double click both, the color of the button changes but the button is not being clicked by Selenium 2.0 (jar 2.45). Please help.
Im using Selenium IDE for record test for my web app.
Selenium IDE do not recognize the right click in my div. I've customized right click over my div and I wanna test relative functions.
Can anyone help me?
Thanks!
Tommaso
Use 'contextMenu' / 'contextMenuAt' to do a right-click.
But as far as i know, you can not record that yet, so you have to add it manually.
I have a link on a page which only appears when hovering over a certain element. But I can't figure out how to emulate this and then click on the link so I can cucumber test it using Capybara and Selenium.
Anyone know how to do this? I've tried executing javascript and and also trying to talk to the selenium driver directly but so far I'm not having much luck...
This question is a few years old, so the answer might have changed. In newer versions of Capybara there are a few different ways to do it, depending on the driver you're using.
For selenium, you can execute javascript:
page.execute_script '$("#element").trigger("mouseover")'
Newer versions of selenium-webdriver support a hover method:
find('#element').hover
For capybara-webkit, the driver supports triggering events on the element:
find('#element').trigger(:mouseover)
I originally found the answer to this question from here and here.
Use Selenium's fireEvent on a mouseover event and then pause for your required hover time.
I have worked on similar one i used following see this might help you.
Using Selenium IDE.
1. Navigate to the required page.
2. Start selenium IDE and Get the Link target.
3. Change the Command to mouseOver Double click the the command in Selenium IDE.
4. It will Show the link wchich you needed.
5. Again Start recording and record the required Link.
When you Double click the mouseOver command it creates the simulation of mouse over through IDE and you can Use your mouse to record the popup link.
Thanks
I finally succeeded in getting Capybara + the Selenium driver to "hover" over an element. This is the code I'm using:
module Capybara
module Node
class Element
def hover
#session.driver.browser.action.move_to(self.native).perform
end
end
end
end
I am new in Selenium automation. Could you please explain me how to use this (if one exists) tag? It would be really helpful if you can give example.
The scenario where I am facing problem is: there is a save button, if we click on it a dialog box pops up. I need to enter some text in two text boxes and press save/cancel button on the same dialog. I am using Selenium as a tool and Python as a scripting language. Any help on this will be appreciated.
Thanks in advance!
sel.click("idOfSaveButton")
sel.wait_for_pop_up("popupWindowName", "30000")
sel.select_window("name=popupWindowName")
sel.type("idOfTextBox1", "someText")
sel.type("idOfTextBox2", "someText")
sel.click("idOfCloseButton")
sel.select_window("null")
You can also select the popup window using title=.
You can wait for the confirm box, then switch to it and do whatever you want. I asked familiar question before and the answer is here. Hope it helps.