We have a web site that also have mobile site, (not app) I'm using C# Selenium WebDriver and our automation framework has 2 classes that Describes the pages in sites, now i want to use the same classes that planed from one to the other but the DOM and LOCATORS (cssSelector,Id...) are different. So I am thinking to take locators out of my code to a data source, But how can I link two data sources (for mobile and Web) to one class for instant? if you have simple example it will be nice Thanks Eyal
How to store Selenium Locators for both products (Web and Mobile app) in one single class?
248 views Asked by EyalChn At
1
There are 1 answers
Related Questions in SELENIUM
- Can't get Selenium element
- Trying to find HREF from table with Selenium in Python
- Python | How i get the link of products that doesn't have href with selenium
- Selenium works only when I'm connected to a remote server
- Logging in automation using Selenium requests / responses- why it wont work?
- Why can't I scrape data from etherscan
- TypeError: 'SwitchTo' object is not callable
- Why driver.get doesn't work in Python Selenium when using Profile
- Trying to fill out an online form using selenium but it can't find the element
- Targeting Accept Policy With Selenium
- Python Selenium - Select Options not returning all the options
- Spraping data from a table is slow but uncertain why
- Unable to convert byte[] image to base64 using cucumber scenario api's - java selenium
- Selenium WebDriver - google account login problem using python
- Click on login button using Selenium
Related Questions in WEBDRIVER
- Getting NullPointerException when trying to use FindElements to read all elements
- Not able to move a google maps map using move_to_element_with_offset() in selenium
- How to resolve is_selected() not returning True even if the checkbox is selected?
- Chrome window appears asking who was currently using Chrome
- Code will run separately but not together for selenium webdriver
- Selenium Google Login Block using webdriver options
- Execute a function in js file referred in source of a html script by using Webdriver/Katalon commands
- In Selenium, how to click on an element under HMTL under iframe. So the hierarchy from big to small: iframe>#document>HTML. I added the scrreenshot
- JMeter WebDriver sampler Windows/Basic authentication
- Unable to locate a precise webelement to be clickable in a list given by Selenium CSS Selector
- Appium/WebdriverIo error appears when running test
- Web Scraping With Selenium in a Docker Container
- Why doesn't Selenium ActionChains work in a loop?
- Bad parameter in WebDriver url causes cross-site request
- How do I run Chrome through Appium (v2) on a windows machine ("No matching capabilities found")
Related Questions in SELENIUM-CHROMEDRIVER
- Selenium ChromeDriver
- How can I find a button element and click on it?
- Bot for investing
- How do i automatically upload pictures from a folder onto canva using python?
- Encountering a problem to interact with a weird button which is a combobox (select)
- @TestNg [TestNG] No tests found. Nothing was run Usage: <main class> [options] The XML suite files to run
- Extract embedded video source link python selenium
- Chrome Selenium CDP Bidi API - Next Commands sended to Target Session have no effect while the initial one does work
- Error: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure
- Why is the copied XPATH not working for selenium?
- Selenium with Chromium driver on Raspberry Pi
- Selenium java error :: unknown error: unhandled inspector error: {"code":-32000,"message":"Not attached to an active page"}
- SessionNotCreatedException: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist)
- Python Selenium Chrome Driver version 123.0.6312.86
- How can I run seleniumbase inside docker?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You can implement a Factory.
In your case you'll get 2 classes: one for the web and one for the mobile app.
When getting the locators instead of instantiating your class you can use the Factory to get the appropriate locators. It will check the platform and return the right object.