Using Selenium (Webdriver) to test Merge - selenium

I'm trying to verify restricted fields aren't merged using the OOB merge. I get to the merge window, but can't figure out how to get selenium to click the "OK" button on the dialog
I've confirmed in the html that the element is the InlineDialog_Iframe, and I've tried xrmBrowser.Dialog.ClickCommand(), as well as SwitchtTo() etc, nothing seems to work.
//select both records
xrmBrowser.Grid.SelectRecord(0);
xrmBrowser.Grid.SelectRecord(1);
//click Merge
xrmBrowser.CommandBar.ClickCommand("Merge");
//click Okay ----what goes here?----

Related

How can I reach the elements of the appeared pop-up using selenium?

In the following ecommerce site "https://www.gittigidiyor.com/", I want to click on "giris yap" button using selenium java but the problem is whenever I hover the mouse to profile icon, this pop-up appears and i try to inspect the pop-up to see the element but nothing happened. Could you please help me how can i click the buttons of this pop-up. I tried by switching to alert/frame but it did not workopened login popup in the site
driver.get("https://www.gittigidiyor.com")
driver.findElement(By.cssSelector("[title=\"Giriş Yap\"]")).click()
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("[data-cy=\"header-login-button\"]"))).click();
To find the element use below technique:
To search xpath of such dynamic elements use DOM break points:
And select break on subtree modification. Now all changes will break and pause the webpage rendering
Click resume execution or press f8 till your span gets displayed

Different results in manual and selenium execution

I have a strange scenario where I click on a button, it performs the button click and shows a filter result doing it manually. However the same is not showing the filtered result during my run in selenium (Note: I could click on that element using xpath/linktext). Appreciate your comments.
Browser.Driver.FindElement(By.XPath("//span[#t='filter']")).Click();

Selenium IDE element not found select an option from dropdownlist

I'm new to selenium
My script is to:
open one website
click one button and then open go to another website
a drop down list will be shown in the new website, i need to select one option from the list
But I failed.
The log said:
Element id=primaryroles not found
I tried to change the target to detailed HTML element, like
//html/frameset/frame/html/body/form/table/tbody/tr/td/div[#id='clientBackground']/table/tbody/tr/td[2]/table/tbody/tr[3]/td/label/select
But it failed as well.
I think the problem may be that new website did not load fully, so i add command "waitforpagetoload" value30000 but the error is time run out
I run out of my brain, please help me :)
The weirdest thing is that i could execute this single command successfully, but i play this current test suit/case, it will fail when it come to this command.
As per the snapshot (without any visibility to your script) you have shared to select from the DropDown you have to use the following Algorithm :
Open one Website
Click one button and then open go to another website
Switch to the Frame with proper WebDriverWait
Use Select Class to identify the DropDown element.
Induce WebDriverWait for your target option to render in the HTML DOM
Click on the intended option

Selenium not working with JQWidgets listbox or Datagrid

I am testing my web site using Selenium IDE 2.9.0 for Firefox.
My web site uses JQWidgets.
Selenium seems to work fine until you need to simulate clicking on a list item or selecting a row from a data grid.
I have seen other posts similar to this problem like this one
Selenium webdriver ‘jqwidgets – jqxgrid ‘ data grid with java: How to scroll and get the rows visible?
but I can't work out the problem.
When I use the record button to record my interaction with the website it shows the following :-
command=click
target=//div[#id='listitem1site_list']/span
When I double click on this to execute the command it does not select the line in my list.
I have tried mouseDown and clicking on the outer div first and every combination.
Any ideas ?
Thanks

Selenium Webdriver 2.30 unable to identify object on the standard Salesforce lookup pop-up window

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: