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();
Related
It was suggested that this had already been answered and then my question was closed.
I've looked at all of the links and I don't see an answer there. Please don't close my question unless you're absolutely sure it's been answered.
Why XPath does not highlighted the yellow mark in Chrome84? (2
answers)
Chrome 84 Inspect element, find results not highlighted in
yellow like before (6 answers) Chrome DevTools not find elements not
search)
I'm writing some Selenium code and need to get the CSS Selector for an item on a page. So I bring up the page and go into Tools mode. It doesn't matter which browser I use - Chrome, FireFox, Edge - when click on the "Pick an element from the page" button (to the left of the Inspector in FireFox) and then click on the item I need the CSS Selector for I see the element in the tools section, but as I'm right-clicking it and choosing Copy->CSS Selector, the table it's in collapses (in a second or two) and I no longer have access to the item I clicked on. I've tried manually expanding the TR in the tools view and drilling down to the TD I need, but the same thing happens.
Anyone know of a way to stop this from happening? I was quick enough to copy a few yesterday but for some reason it seems to be happening faster today and I'm not able to catch it.
Right-clicking the item and choosing Inspect Element was also suggested but that does the same thing. The item shows up in the tools section for about 2 seconds and then the table collapses.
When the element tree collapses, it is a sign that it got updated. This happens, for example, when an iframe's URL or document is changed or the child tree structure gets replaced via JavaScript.
In order to stop this from happening, you can stop the JavaScript execution on the next execution once you see the element you want to inspect. Then you are able to inspect the element using the inspect button.
Firefox
Switch to the Debugger panel.
Once you see the element you want to inspect, click the Pause button or press F8.
Cause the JavaScript execution to stop (e.g. by interacting with the page). You can see that the JavaScript execution is stopped when there is a white overlay on the page and a hint saying Paused at Execution.
Once the execution is stopped, click the Pick an element from the page button in the toolbar or press Ctrl+Shift+C.
Click the element you want to inspect.
Chrome/Edge
Switch to the Sources panel.
Once you see the element you want to inspect, click the Pause script execution button or press F8.
Cause the JavaScript execution to stop (e.g. by interacting with the page). You can see that the JavaScript execution is stopped when there is a hint on the page saying Paused in debugger.
Once the execution is stopped, click the Select an element in the page to inspect it button in the toolbar or press Ctrl+Shift+C.
Click the element you want to inspect.
I found a semi-workable solution. When the item appears in the tools window note it's name before it disappears. Then go to the Search HTML box and type it's name. It still appears and then disappears, but it seems to stay visible longer.
I tried clicking on down arrow button for a Combo Box (Select is not available. Its a React JS application and once I click on arrow button only list shows selection items) using below karate command but click not happened in application and no error displayed. [The same xpath worked in selenium click command,and showing unique item on Inspect search]
And waitFor("//div[#id='root']/div/div[3]/main/div/div[3]/div[2]/div")
And click("//div[#id='root']/div/div[3]/main/div/div[3]/div[2]/div")
Note: Then I tried below command
And assert('//div[#id='root']/div/div[3]/main/div/div[3]/div[2]/div').exists
and got error
javascript evaluation failed: assert('//div[#id='root']/div/div[3]/main/div/div[3]/div[2]/div').exists, :1:19 Expected , but found root
assert('//div[#id='root']/div/div[3]/main/div/div[3]/div[2]/div').exists
It would really help us if you follow this process, it is simple and should not take much time for you to give us a small snippet of static HTML (or you can mix react if really needed).
https://github.com/intuit/karate/tree/master/examples/ui-test
EDIT: you also seem to have mis-matched single and double-quotes in your code.
Also note that you should be able to fire a JS event or click by using the script() API. See this example: https://github.com/intuit/karate/tree/master/karate-core#script
So this is an alternate approach to be able to overcome any tricky situation that comes up.
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?----
I am new to Selenium, I am using Selenium IDE to record test scripts.
I am having trouble while executing one of the recorded test cases in Firefox. It is a simple test case which clicks a button and then clicks on OK button of the pop up window .This is the page link for which I am creating script.
Below are the three steps recorded from IDE
The problem is that after the second step, i.e., click step, no pop up is being shown, the same happens in the next step.
The pop up is not displayed yet the test case gets executed correctly.
Could someone please let me know why I am not able to view the pop up ?
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