Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
HemaPen
Posts : 7
Join date : 2013-06-20

To select an element inside a folder in a Tree structure UI uisng selenium web driver calls Empty To select an element inside a folder in a Tree structure UI uisng selenium web driver calls

Mon Jul 22, 2013 6:55 pm
hi,

   We have to do automation for testing our product which is a  web based UI product. It has a tree structure just like windows explorer. 

Folder1
  ->element1
  ->element2

When the software comes up, Folder1 is not always open(double clicked state).
If it is not open I want to double click so it opens. 

How do I check if it is already open? Because if it is already open and I do double click it closes the folder.

secondly: How do i get the element Element1 and right click on it to select one more option?

I tried to get findElements(by.xpath(of Folder1)); which is returning null.
I also tried findElement(by.xpath(of element1)); which is not working. it says un selectable element, as that element unselectable=on.

My requirement is open the Folder1, right click on element1 and select 4th item in the menu.

Any solution will be highly appreciated.


I figured out that contextClick doesnt work with chrome driver, have to wait for Chrome version 30+. 
So now I have switched to firefox driver.  I get the context menu, have about 9 options grouped into
4, 2, 3, 1... I wanto select 6th conext menu option. 

This is what I am trying to select 6th item by sending 6 ARROW_DOWN.

newAction.contextClick(pgmFolder).sendKeys(Keys.chord(Keys.ARROW_DOWN, Keys.ARROW_DOWN,Keys.ARROW_DOWN,Keys.ARROW_DOWN,Keys.ARROW_DOWN,Keys.ARROW_DOWN,Keys.RETURN));


What is happening is irrespective of how many ARROW_DOWN I send it only selects 4th option.

Any clue as to what is happening?
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

To select an element inside a folder in a Tree structure UI uisng selenium web driver calls Empty Re: To select an element inside a folder in a Tree structure UI uisng selenium web driver calls

Mon Sep 16, 2013 7:26 pm
is it possible for you to provide website URL?
It would be helpful..You can send me in private mail..
avatar
mail2prassad
Amateur
Amateur
Posts : 41
Join date : 2013-06-05

To select an element inside a folder in a Tree structure UI uisng selenium web driver calls Empty Re: To select an element inside a folder in a Tree structure UI uisng selenium web driver calls

Tue Sep 17, 2013 8:06 pm
Mostly the tree structures are built using client side libraries like JQuery or by ajax calls, also it varies with the implementation. the elements may be present with null values or the elements may be dynamically generated (DHTML).

Here findElements(by.xpath(of Folder1)); returns null, this may be because you are trying to look at the elements even if the folder structure is closed. you can only query this only if the the folder is open. Add a check to see if the folder is open. 


Regarding the 4th option selection, it is not clear how the elements are grouped. It looks like the control is not going to the next group. the first group contains 4 elements, second group contains two elements, so to select the 6th element, you need to go to second group and click on the last element. It looks like the control is ending up in first group and clicking on the last element (4th element) because there is no 6th element. Try selecting 2nd or 3rd element, it should work fine.
You may need to modify your code so that the control goes to the next group to select the required option.


Best,
Prassad
Sponsored content

To select an element inside a folder in a Tree structure UI uisng selenium web driver calls Empty Re: To select an element inside a folder in a Tree structure UI uisng selenium web driver calls

Back to top
Permissions in this forum:
You cannot reply to topics in this forum