File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
py/selenium/webdriver/remote Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1414# KIND, either express or implied. See the License for the
1515# specific language governing permissions and limitations
1616# under the License.
17+ from selenium .webdriver .common .by import By
1718
1819
1920class LocatorConverter :
2021 def convert (self , by , value ):
2122 # Default conversion logic
22- if by == "id" :
23- return "css selector" , f'[id="{ value } "]'
24- elif by == "class name" :
25- return "css selector" , f".{ value } "
26- elif by == "name" :
27- return "css selector" , f'[name="{ value } "]'
23+ if by == By . ID :
24+ return By . CSS_SELECTOR , f'[id="{ value } "]'
25+ elif by == By . CLASS_NAME :
26+ return By . CSS_SELECTOR , f".{ value } "
27+ elif by == By . NAME :
28+ return By . CSS_SELECTOR , f'[name="{ value } "]'
2829 return by , value
You can’t perform that action at this time.
0 commit comments