I just need to click on "OK" , the pop up generated by web page , i m not able to perform click operation on pop-up generated by web page in Automation Anywhere
enter image description here
Normally the object Cloning command works on that type of windows, you just need to put the main window of the object cloning as "Message from webpage" instead of the main webpage.
If not Image recognition shpuld work perfectly
You can use selenium. use find_by to locate the popup element.
close_button = driver.find_elements_by_class_name("popover-x-button-close")[0]
close_button.click()
sum_div.click()
driver.implicitly_wait(2)
Related
I am trying to use mink and behat to test out my application. One of the tests requires me to press on a button, but that button is tied to a javascript event. Not an actual form.
When I run the test I keep getting the following error message.
The selected node does not have a form ancestor.
Is there way I can emulate the press button without having a form?
Any help would be really appreciated. Thanks
Goutte (and Guzzle) will not parse / run the javascript contained within an http response. As a result you can test for the existence of the button, but not if any events associated with the button actually fire. To test for the javascript based events you will have to use a different mink-driver. I refer you to Documentation on in Browser Testing and mink documentation on available drivers.
A
I have a webpage where I click on a button and an open dialog it's opened and I should select the file to upload. After that, a pop up is displayed saying OK or KO.
I'm able to upload files when the there are files types. But in this case, the element where I click it's:
<
button type="button" read-file="_.partial(submitLang, selectedLang)" id="import-lang" class="btn btn-default"><
/button>
For the rest of the application, I use this and it works:
WebElement element = getPage().findElementById(id);
element.sendKeys(absoluteFile);
But for button types and button tag it doesn't work.
How can I do it? The tests are running on a Linux machine
Thanks a lot!
More info!!
Hi all,
The whole process is: (see image at http://imageshack.com/a/img540/6237/JoTQng.png)
Click on Import button
A dialog is opened and I select a .json file and click Open
An alert is displayed saying "Text properties have been updated".
We are using angular for the frontend and all are REST calls.
We don't have any "file=type". All three are buttons. You can found more code at
http://imageshack.com/a/img633/7299/BQhP7o.png
For a file upload with selenium, you need to find an input tag with the type "file".
Have a look at your HTML and search for it.
When you found it, the rest is pretty straightforward:
Let's say this input-element has id="import"
driver.findElement(By.id("import")).sendKeys(absoluteFile);
If you run into problems, please post more of your HTML, then I can have a look at it.
In my case, clicking on the button made an element appear in the HTML code, I assume due to javascript.
I clicked on the element (which both opens a file upload window and adds the to the HTML), and immediately after send the keys to the input element.
This creates the problem of having to close the newly opened file upload window, however this is not a problem when using --headless mode on google chrome.
I do not have a solution to close this window if you are not in headless mode for your chosen browser.
i wrote a (visual basic.net-2008) desktop app that allows ham radio operators to enter a call,
such as WA0H, and the program gives the ham's location (springfield, mo.).
you can download the program free from my website .. www.wa0h.com
i want the program to display the ham's location on a google map using google's api-v3.
i have created an (html/javascript) webpage, where you enter the location in a form box,
click a (find) button, and the app displays the map ok, including a marker pin on the map.
??? how do i run the (webpage) from inside my (vb.net) program ???
my vb.net program needs to:
1 .. pass the address to the webpage
2 .. click the webpage (find) button
according to the google maps (developers) website, they want questions posted to stackoverflow.
thanks for your time.
1-First you need to create pin on the map
i suggest using Google Static Maps API as in hear : https://developers.google.com/maps/documentation/static-maps/intro#quick_example
for the example use this
https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&key=YOUR_API_KEY
then you get something like this
https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&key=AIzaSyDnw6k3UjE2qZ5nLnI8cKghaEEdCXV0PUI&signature=5xiF2jgoXwFonsjew0PmtZdSTHU=
2-you need to open this page using web browser.
to use "WebBrowser" inside of toolbox, drag and drop it then set ScriptErrorsSuppressed to true
to set webbrowser url you can use webbrowser1.navigate("your url as string")
I am using Selenium Webdriver to automate functional TC in Salesforce application.
Test Scenario:
- On a case page, clicking the "Lookup" i.e., search icon opens up standard Salesforce search popup. I need to input specific string to the search field and click "Go" button.
Although I am able to click on the Search button, the script fails to identify any field on the popup.
I used Alert(), getWindowHandle & iterator functions to verify if the driver is working on the popup window. Yes it is.. the popup is is the working window. I could able to confirm this using the Java id for the browser window. But still it fails to identify any fields.
Let me know if any of you faces similar issue and any solution.
Do let me know if you like to have access to my working sandbox. Would be able to manage it.
Thanks, Manju
I believe the problem is that the elements inside the popup window are in a frame. After switching to the new popup window you need to switch to the frame first before being able to access any of those elements using:
WebElement frameLocator = driver.findElement(By.id("searchFrame"));
driver.switchTo.frame(frameLocator);
Further to Bob's answer you'll also then need to switch to the "resultsFrame" in order to use any of the links returned by the search. Note that in order to switch to a sibling frame you must first go up to the parent of the frameset using:
driver.switchTo().defaultContent();
(frameset guidance here: http://darrellgrainger.blogspot.co.uk/2012/04/frames-and-webdriver.html)
With Selenium IDE:
I was able to select the Salesforce PopUP with this code:
Command:selectPopUp
Target:
Value: Your popUp title
And the result frame:
Command:selectFrame
Target: name=resultFrame
Value:
I need to automate the "Browse" button click from Selenium.
For this, I have tried
driver.findElement(By.xpath("//*[#id=\"dnn_ctr383_View_filename\"]")).click();
and
driver.findElement(By.cssSelector("Css path")).click();
Both gives me org.openqa.selenium.NoSuchElementException: Unable to locate element: exception.
I have seen this link here where the author suggest to use AutoIT, but in step 2, the script, the author has created is for IE. Can someone please suggest, how I can automate the "Browse" button click in firefox?
Any help is much appreciated.
Directly send the file path to the id, like so
driver.findElement(By.id("dnn_ctr383_View_filename")).sendKeys("C:\\path\\to\\file");
The above step is the answer for your first two steps
Click on Browse
Select a file to upload
For the third step(click upload), looking at the screen capture I do not see any button which says "Upload". So just click "Save" and I assume that your file will successfully get uploaded.
There are two things that u need to consider here:
Clicking the browser button: Usually handled by an alert or popup, if the driver is not able to find the element by xpath(which u have acquired from firebug or chrome's inspect element) you should consider looking for iframes in the page source. If an element is in a different frame altogether , u need to switch frames in order to find the element like this
WebElement frame = driver.findElementById("name_of_iframe");
driver.switchTo().frame(fr);
now you can find your element using xpath or css selector like u did. Once completed u can move out of the frame by:- driver.switchTo().defaultContent();
Uploading the file from desktop: Since selenium works only on the html in the browser session u invoked from the driver, it can't perform operations on your desktop.Once you are able to click the browser button u can use Auto it(works only on windows) or Sikuli(works with mac, linux, windows and even android) to simulate your events based on the position of your upload button.
Hope this helps