Selenium doesn't navigate text with shortcuts like CMD+UP or ALT+UP - selenium

On any text form, I can use CMD+UP to navigate at the very top or OPTION+UP to navigate to the start of the paragraph. That works in any browser on macOS.
Why it does not work from Selenium?
I tried this in Java and an equivalent in Typescript -
new Actions(driver).keyDown(Keys.ALT).sendKeys(Keys.ARROW_UP).keyUp(Keys.ALT).perform();
Surprisingly, I can jump words using ALT+ARROW_LEFT.
Is there any workaround to jump to the beginning of the paragraph?

Related

Click not working on combo-box down arrow button karate UI testing

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.

Robot Framework - Selenium2Library - Chrome & Edge open new tab instead of window

Sorry if this is a mundane question.
My issue is that the user can click on the "Help" button, which by default will open in a new tab, the help page.
When firing the test in Firefox, it creates a new window. Which is great as I can use the Select Window keyword and give it the URL. However, with Chrome and Edge, it just makes a new tab.
I read that Tabs aren't supported - But the weird part is, the test on Edge passes fine, it is just Chrome which is having the problem. Is there a reason behind that?
Is there a way to force it to be a Window and not a Tab? Or something?
I read that I can input a keyboard shortcut of CTRL + Tab. But that feels really dirty and would prefer a better way of doing it.
Error:
ValueError: Unable to locate window with URL 'http://...
EDIT
OK - So instead of using the URL param, I tried the title instead. Just on a whim. And it worked (?) I have no idea how it worked and why using the URL didnt and the title did: Here are the lines I used:
Run Keyword If '${Browser}' == 'Chrome'
... Select Window 1.7.1 User Guide
... ELSE
... Select Window 1.7.1 User Guide - Welcome to the User Guide
Still though, both the "Gets" did not produce a link to the newly created tab / window though :/ - Many thanks to shicky and Helio!
Are tabs not handled largely the same as windows? You should be able to identify what is on the screen as #Helio says by using one of the following:
Get Window Identifiers
Get Window Names
Here are some similar questions that should help you get started, post back here with some further detail if you need more help.
How to get the current URL in Robot framework?
How to make chrome display on the top opened in selenium [Mac OS X]

How to switch between the list of tests and the output/console inside the run window using the keyboard?

When I run tests and open the run window using the Alt+4 shortcut, I find the cursor either in the list of tests on the left or in the console/output on the right.I would like to switch back and forth between the two using the keyboard only.
I have searched in the keymap, the online help and have posted in the RubyMine forum but could not find an answer.
Experimenting with Alt/Ctrl/Shift+Arrows/Tabs/Numbers combos did not help.
The window parts are not individually selectable in the window switcher (Ctrl+E).
I am using RubyMine 5.4.3.2.1
Thank you.
As far as I can see, using Intellij 13.0.1, or a derived IDE, like RubyMine 6 Tab should work, with certain nuances.
When the focus is on the list of tests initially, I am able to tab between the list of tests and the console - the thing is, I cant see a cursor when I tab to the console/output, but if I use shift-up/down to I can see that the console definitely has the focus.
Pressing Tab again puts focus back to the list of tests on the left.
If the focus is in the console/output initially, pressing Tab has no effect and I have to use the mouse to 'escape'.
Earlier versions, based on ItelliJ 12 seem not to support this feature.
I hope this helps.

Selenium IDE unable to palyback with FCK Editor text

i am new to selenium and works in a complex project where there is a need to record and playback all modules. So i have a web page with FCK Editor field where user have to enter text. I recorded successfully , but IDE doesnt enters into editor text area to enter any message while play back the test case.
Please help me to overcome the issue.
runScript
CKEDITOR.instances['body'].setData('<p>testContent</p>');
change "body" for the name of your ckEditor instance

Use of 'ClickAt ' selenium command

I'm confused about the difference between the Click and ClickAt commands in selenium. Where can I use the ClickAt command?
Here are what Selenium IDE says about those two commands :
click(locator) Arguments:
locator : an element locator
Clicks on a link, button, checkbox or
radio button. If the click action
causes a new page to load (like a link
usually does), call waitForPageToLoad.
And :
clickAt(locator, coordString) Arguments:
locator : an element locator
coordString : specifies the x,y position (i.e. - 10,20) of the mouse
event relative to the element returned
by the locator.
Clicks on a link, button, checkbox or
radio button. If the click action
causes a new page to load (like a link
usually does), call waitForPageToLoad.
click is used when you just want to "click" on an element, like a button, a link, ...
And clickAt is used when you want to "click" on a position designated by mouse coordinates.
I suppose the second one can be useful for some "rich" applications -- I've actually never used it... On the other hand, I use click like all the time.
If you have a page with form elements, links, buttons, and stuff like that, you'll probably generally use click : it's way easier to find an element using it's id or classname than having to find it's position in pixels on the page ^^
I noticed some differences between click() and clickAt() when testing a ExtJS app.
For example, if I try to click a tab in a Ext.TabPanel, click() command does not work, although I provide it with an correct xpath, and clickAt() works fine.
Code looks like this:
click("//li[#id='tab-panel-id__second-tab-id']/a[2]/em/span/span")
doesn't work, but
clickAt("//li[#id='tab-panel-id__second-tab-id']/a[2]/em/span/span","0,0")
works.
Notice that coordinates are (0,0)
I can't figure out why this happens...
I'm testing a GWT application and it seems like I have to use clickAt if I want to click on a node in a tree widget.
Be careful when testing clickAt. Sometimes double clicking the command will cause it to show up red. You will change the line to try other alternatives but nothing will work. But then run your script and the clickAt line will be fine with whatever you type in.
There is a dojo widget at our application which only works with clickAt("//span[#id='mastheadIconBar']/span[1]/span/span","0,0").
Don't know why, but only click("//span[#id='mastheadIconBar']/span[1]/span/span") does not work.