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 14
14
# KIND, either express or implied. See the License for the
15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
+ from selenium .webdriver .common .by import By
17
18
18
19
19
20
class LocatorConverter :
20
21
def convert (self , by , value ):
21
22
# 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 } "]'
28
29
return by , value
You can’t perform that action at this time.
0 commit comments