Hi,
We are using SmartClientWebDriver for automation.
Used version of SmartGWT
smartgwtee-eval-5.0p
Browser:Firefox/Chrome
We have a Image, To identify that image we used sclocator and below is the locator given by selenium ID with firefox browser. (After adding user-extensions.js and user-extensions-ide.js files)
scLocator=//TabSet[ID="page_MainWindowView_TabSet_mainScreenTabSet"]/paneContainer/member[Class=VLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=VLayout||index=0||length=2||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=ImgButton||index=1||length=8||classIndex=1||classLength=7||roleIndex=1||roleLength=7||scRole=button||name=page_GroupTabLayout_gr_100100_ImgButton_discoverButton]/
On clicking on that image, Image source change from "Search_Start.png" to "Search_Pause.png", and UI will now display different image.
On this state if we look at sclocator (As mentioned below) is same as above one.
scLocator=//TabSet[ID="page_MainWindowView_TabSet_mainScreenTabSet"]/paneContainer/member[Class=VLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=VLayout||index=0||length=2||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=ImgButton||index=1||length=8||classIndex=1||classLength=7||roleIndex=1||roleLength=7||scRole=button||name=page_GroupTabLayout_gr_100100_ImgButton_discoverButton]/
Here only way i can differentiate two state of the image buttor using src attribute under img tag.
src complete path contains server IP (Ex:http://ServerIP:Port/Module1/images/common/tabIcons/24x24/Search_Start.png) but i can not use complete path since server IP and Port is keep changing.
Same case in Xpath we have option of contains() function.So that we can check like as mentioned below
Image1 : .//*[contains(@name,'gr_dummyGrpID_ImgButton_discoverButton') and contains(@src,'Search_Start')]
Image2: .//*[contains(@name,'gr_dummyGrpID_ImgButton_discoverButton') and contains(@src,'Search_Pause')]
How do we do it in sclocator to solve this case.?
Is there option in sclocator that only partial string can be used instead of full ID,attribute value?
Thanks
We are using SmartClientWebDriver for automation.
Used version of SmartGWT
smartgwtee-eval-5.0p
Browser:Firefox/Chrome
We have a Image, To identify that image we used sclocator and below is the locator given by selenium ID with firefox browser. (After adding user-extensions.js and user-extensions-ide.js files)
scLocator=//TabSet[ID="page_MainWindowView_TabSet_mainScreenTabSet"]/paneContainer/member[Class=VLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=VLayout||index=0||length=2||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=ImgButton||index=1||length=8||classIndex=1||classLength=7||roleIndex=1||roleLength=7||scRole=button||name=page_GroupTabLayout_gr_100100_ImgButton_discoverButton]/
On clicking on that image, Image source change from "Search_Start.png" to "Search_Pause.png", and UI will now display different image.
On this state if we look at sclocator (As mentioned below) is same as above one.
scLocator=//TabSet[ID="page_MainWindowView_TabSet_mainScreenTabSet"]/paneContainer/member[Class=VLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=VLayout||index=0||length=2||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=HLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=ImgButton||index=1||length=8||classIndex=1||classLength=7||roleIndex=1||roleLength=7||scRole=button||name=page_GroupTabLayout_gr_100100_ImgButton_discoverButton]/
Here only way i can differentiate two state of the image buttor using src attribute under img tag.
src complete path contains server IP (Ex:http://ServerIP:Port/Module1/images/common/tabIcons/24x24/Search_Start.png) but i can not use complete path since server IP and Port is keep changing.
Same case in Xpath we have option of contains() function.So that we can check like as mentioned below
Image1 : .//*[contains(@name,'gr_dummyGrpID_ImgButton_discoverButton') and contains(@src,'Search_Start')]
Image2: .//*[contains(@name,'gr_dummyGrpID_ImgButton_discoverButton') and contains(@src,'Search_Pause')]
How do we do it in sclocator to solve this case.?
Is there option in sclocator that only partial string can be used instead of full ID,attribute value?
Thanks
Comment